Laravel 5.2プロジェクトのキャッシュをクリアすると、次のエラーメッセージが表示されます。
[LogicException]シリアル化のためにルート[パネル]を準備できません。クロージャを使用します。
ルートと関係があると思います
Route::get('/article/{slug}', 'Front@slug');
私のコントローラーの特定のメソッドに関連付けられています:
public function slug($slug) {
$article = Article::where('slug',$slug)->first();
$id = $article ->id_article ;
if ( ($article=== null) || (is_null($id)) ) return view('errors/Db');
else return view('detail')->with(array('article'=> $article, 'title'=>'My title - '.$article->title));
}`
In short, from a master view I pass $slug, that is a shortlink to the article, with $slug , which is unique in the database, I identify the record and then I pass it's contents to the detail view.
I didn't have any problem when I wrote the method, infact it worked like a charm, but after I cleaned caches, I get that error and the links in the master view don't show any shortcode.
Where am I doing wrong?