route resource laravel

Solutions on MaxInterview for route resource laravel by the best coders in the world

showing results for - "route resource laravel"
Tim
22 Jul 2017
1php artisan make:controller MyController
Keenan
28 Jan 2019
1// Implicit Model Binding Routes can be created with one line using either:
2Route::resource('photos', PhotoController::class);
3// OR
4Route::resources([
5	'photos' => PhotoController::class,
6    'posts' => PostController::class,
7]);
8
9php artisan make:controller PhotoController --resource --model=Photo
10  // makes a controller with stubouts for methods:
11  // index
12  // create
13  // store
14  // show
15  // edit
16  // update
17  // destroy 
Niko
27 Oct 2020
1Route::resources([
2    'photos' => 'PhotoController',
3    'posts' => 'PostController',
4]);
Audriana
10 Feb 2017
1By default, all resource controller actions have a route name;
2however, you can override these names by passing a names array
3with your desired route names:
4
5use App\Http\Controllers\PhotoController;
6
7Route::resource('photos', PhotoController::class)->names([
8    'create' => 'photos.build'
9]);
Jazmín
11 Feb 2019
1Verb          Path                        Action  Route Name
2GET           /users                      index   users.index
3GET           /users/create               create  users.create
4POST          /users                      store   users.store
5GET           /users/{user}               show    users.show
6GET           /users/{user}/edit          edit    users.edit
7PUT|PATCH     /users/{user}               update  users.update
8DELETE        /users/{user}               destroy users.destroy
Magdalena
09 Nov 2017
1php artisan make:controller PhotoController --resource --model=Photo
similar questions
queries leading to this page
route resource laravel