php artisan make:controller PhotoController --resource --model=Photo
Route::resource('photos', PhotoController::class);
php artisan make:controller PhotoController --resource --model=Photo
php artisan make:controller RequestRevisionController --resource
use AppUser;
use AppHttpResourcesUser as UserResource;
Route::get('/user', function () {
return (new UserResource(User::find(1)))
->response()
->setStatusCode(200);
});
Route::resource('my/path/to/whereever/I/like', 'MyController', [
'names' => [
'index' => 'my_route_base_name.index',
'edit' => 'my_route_base_name.edit',
'create' => 'my_route_base_name.create',
etc...
],
])
php artisan make:resource ResourceName
Resource Controller:This controller will create all CRUD methods
php artisan make:controller nameOfController --resource
php artisan make:controller User/AdminController -r
php artisan make:controller NameController --resource
php artisan make:model -a -r modelName