jeudi 14 septembre 2017

Larave 5.5 Route groups

I was having this in my website using Laravel 5.3 :

Route::group(['namespace' => 'Admin', 'prefix' => 'admin', 'middleware'=>'auth'], function(){
    Route::resource('posts', 'PostsController');
});

This lets me go to the admin panel using : mywebsite/public/admin/posts.

Now, when i migrated the site to Laravel5.5 i got this error Route[admin.posts.create] not defined when i attempt to open the link <a href="route('admin.posts.create')">Create post</a> which was working fine before.

I know that routing system has changed but i did not know how to have such links in new Laravel5.5. I tried url instead of route but i got the same error. I also checked the new documentation but i did not get exactly how to have the same link system.

Can anyone have a better explanation of this new routing system ? (i have to migrate the site to 5.5).

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire