make resource in laravel
php artisan make:controller PhotoController --resource --model=Photo Route::resource('photos', PhotoController::class);
Here is what the above code is Doing:
1. We’re creating a new controller called PhotoController.
2. We’re telling Laravel to create all the methods for a resource controller.
3. We’re telling Laravel to use the Photo model when it generates the controller.
Now, let’s take a look at the controller that was generated: