为了账号安全,请及时绑定邮箱和手机立即绑定

在Laravel中显示“艺术家”表中的数据时出现问题

在Laravel中显示“艺术家”表中的数据时出现问题

PHP
料青山看我应如是 2021-05-04 12:39:07
我无法显示数据库中的数据(我正在使用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)<?phpRoute::get('/', function () {    return view('welcome');});Route::get('artists', 'ArtistController@index');控制器(Controllers \ ArtistController.php)当我进入浏览器时,唯一显示在我的浏览器上的127.0.0.1:8000/artists是:**Liste des Artistes**  Firstname Lastname但是,从我的艺术家表的内容中没有显示任何内容。
查看完整描述

1 回答

?
MYYA

TA贡献1868条经验 获得超4个赞

问题在于我需要更改列的名称...

从“姓氏”到“姓氏”

数据现在可以正确显示。


查看完整回答
反对 回复 2021-05-21
  • 1 回答
  • 0 关注
  • 114 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信