php artisan make:controller PhotoController --resource --model=Photo
Route::resource('photos', PhotoController::class);
//creating a resource collection
php artisan make:resource ResourceCollectionName --collection
//creating a resource
php artisan make:resource ResourceName
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);
});
php artisan make:resource ResourceName
Resource Controller:This controller will create all CRUD methods
php artisan make:controller nameOfController --resource
php artisan make:resource UserResource
php artisan make:controller User/AdminController -r
php artisan make:controller NameController --resource
php artisan make:model -a -r modelName