Понять не могу почему laravel ругается, то что переменная не определена
Весь код файла productList.blade.php:
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="btn btn-block"><a href="{{ route('product.create') }}"><h2>Add New Product</h2></a></div>
@foreach( $allProducts as $product )
<hr>
<div class="row">
{!! HTML::linkRoute('product.edit', 'Edit', array($product->id), ['class'=>'btn btn-default col-xs-2']) !!}
{!! Form::open(['route' => ['product.destroy', $product->id], 'method' => 'delete']) !!}
<input class="btn btn-default col-xs-2" type="submit" value="Удалить" />
{!! Form::close() !!}
</div>
<div><h1>{!! HTML::linkRoute('product.show', $product->title, array($product->id)) !!}</h1></div>
<div>{{ $product->description }}</div>
<div class="pull-right"><em>{{'Опубликовал -'. $product->author }}</em>
</div>
@endforeach
{!! Form::open(['route' => ['product.destroy', $product->id], 'method' => 'delete']) !!}
<input class="btn btn-default col-xs-2" type="submit" value="Удалить" />
{!!Form::close() !!}
</div>
</body>
</html>
Мой контроллер:
public function index()
{
$allProducts = Product::all();
return view('products.productList', compact('allProducts'));
}
Модель:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
protected $table = 'products';
protected $fillable = [
'title',
'description',
'author',
'image'
];
}