laravel create controller
php artisan make:controller MyController
laravel create controller
php artisan make:controller MyController
laravel create controller command
php artisan make:controller UserController
laravel api response trait
trait RespondsWithHttpStatus
{
protected function success($message, $data = [], $status = 200)
{
return response([
'success' => true,
'data' => $data,
'message' => $message,
], $status);
}
protected function failure($message, $status = 422)
{
return response([
'success' => false,
'message' => $message,
], $status);
}
}
Route::resource
Route::resource('photos', PhotoController::class);
laravel make api resource
php artisan make:resource User --collection
php artisan make:resource UserCollection
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us