mardi 10 juillet 2018

Route Name Prefixes with resource controller - Laravel 5.5

Route & Prefix has same name. I'm not able to update the Hotel resource controller. What is the best way to use prefix and resource controller with same name?

Routes/web.php

Route::namespace('Admin\Hotel')->prefix('hotels')->name('hotels.')->group(function () {
    Route::resource('/', 'HotelController');
    Route::resource('gallery', 'HotelGalleryController');
    Route::resource('rooms', 'RoomController');
    Route::resource('rooms/gallery', 'RoomGalleryController', ["as" => "room-gallery"]);
});

php artisan route:list for Route::resource('/', 'HotelController')

enter image description here

php artisan route:list if i change it to Route::resource('hotels', 'HotelController')

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire