我有一个Laravel错误,在此代码中找不到任何内容

时间:2019-12-13 02:03:28

标签: laravel laravel-5.7

我正在使用Laravel 5.7,但此代码中出现错误。

CustomersController.php

<?php

use App\Customers;
use Illuminate\Http\Request;

class CustomersController extends Controller
{
   public function list() 
   {
      $customers = Customer::all();
      return view('internals.costumers.blade.php',[
          'customers' => $customers
      ]);
   }
}

internals.costumers.blade.php

@extends('layout')

   @section('content')
      <h1>This is Customers</h1>
      <ul>
         @foreach ($customers as $customer)
           <li>{{ $customer->name }}</li>
         @endforeach
     </ul>
   @endsection

1 个答案:

答案 0 :(得分:0)

请在控制器中定义名称空间,并在视图帮助器中仅传递带参数的刀片文件名称,而不是扩展名.blade.php