Verb Path Action Route Name
GET /users index users.index
POST /users store users.store
GET /users/{user} show users.show
PUT|PATCH /users/{user} update users.update
DELETE /users/{user} destroy users.destroy
When declaring resource routes that will be consumed by APIs,
you will commonly want to exclude routes that present HTML
templates such as "create" and "edit"
//Route=>
use AppHttpControllersPhotoController;
Route::apiResource('photos', PhotoController::class);
//artisan command =>
php artisan make:controller PhotoController --api
php artisan make:resource UserResource
php artisan make:resource User --collection
php artisan make:resource UserCollection
php artisan make:resource User --collection
php artisan make:resource UserCollection
GET - "/photos/{photo}/comments" - index
GET - "/photos/{photo}/comments/create" - create
POST - "/photos/{photo}/comments" - store
GET - "/comments/{comment}" - show
GET - "/comments/{comment}/edit" - edit
PUT/PATCH - "/comments/{comment}" - update
DELETE - "/comments/{comment}" - destroy
php artisan make:controller PhotoController --api