Zrób kontroler Laravel 8 z zasobem
php artisan make:controller PhotoController --resource --model=Photo
Route::resource('photos', PhotoController::class);
Strange Sandpiper
php artisan make:controller PhotoController --resource --model=Photo
Route::resource('photos', PhotoController::class);
php artisan make:controller PhotoController --resource --model=Photo
use App\User;
use App\Http\Resources\User as UserResource;
Route::get('/user', function () {
return (new UserResource(User::find(1)))
->response()
->setStatusCode(200);
});
php artisan make:resource ResourceName
php artisan make:controller User/AdminController -r