Answers for "api controller laravel"

7

laravel create resource controller

php artisan make:controller PhotoController --resource --model=Photo
Posted by: Guest on April-23-2020
0

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);
    }
}
Posted by: Guest on September-02-2020

Code answers related to "api controller laravel"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language