vendredi 19 octobre 2018

simple route defined by Route::view gives an error

The case is very simple, but I found no references to it:

  1. I have a blade \front\about
  2. I have a line in layout.blade.php: <li ><a href="">About Us</a></li>

When I define a route in web.routes as

Route::view('/about', 'front.about');

it fails on:

Route [about] not defined. (View: ....\resources\views\front\layout.blade.php) 

Everything works well when I define the route via

Route::name('about')->get('about',function() { return View::make('front.about');});

Except, it (obviously) fails on $ php artisan route:cache, since being closure

Unable to prepare route [about] for serialization. Uses Closure.

Please help to resolve the case.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire