我无法显示数据库中的数据(我正在使用Laragon)。
我已经试图在这里和那里更改一些名称(变量等),但是我找不到问题的根源。
我首先无法显示任何内容,因此需要进行以下更改:
resources \ views \ artist \ index.php-> resources \ views \ artist的\ index。刀片.php
我可能需要更改代码中的更多内容,但我不知道在哪里。
查看(views \ artists \ index.blade.php)
@extends('layouts.app')
@section('title', 'Liste des artistes')
@section('content')
<h1>Liste des {{ $resource }}</h1>
<table>
<thead>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
</thead>
<tbody>
@foreach($artists as $artist)
<tr>
<td>{{ $artist->firstname }}</td>
<td>{{ $artist->lastname }}</td>
</tr>
@endforeach
</tbody>
</table>
@endsection
路线(routes \ web.php)
<?php
Route::get('/', function () {
return view('welcome');
});
Route::get('artists', 'ArtistController@index');
控制器(Controllers \ ArtistController.php)
当我进入浏览器时,唯一显示在我的浏览器上的127.0.0.1:8000/artists
是:
**Liste des Artistes** Firstname Lastname
但是,从我的艺术家表的内容中没有显示任何内容。
MYYA