1When declaring resource routes that will be consumed by APIs,
2you will commonly want to exclude routes that present HTML
3templates such as "create" and "edit"
4
5//Route=>
6use App\Http\Controllers\PhotoController;
7Route::apiResource('photos', PhotoController::class);
8
9//artisan command =>
10php artisan make:controller PhotoController --api
11
1php artisan make:resource User --collection
2
3php artisan make:resource UserCollection
1GET - "/photos/{photo}/comments" - index
2GET - "/photos/{photo}/comments/create" - create
3POST - "/photos/{photo}/comments" - store
4GET - "/comments/{comment}" - show
5GET - "/comments/{comment}/edit" - edit
6PUT/PATCH - "/comments/{comment}" - update
7DELETE - "/comments/{comment}" - destroy