jeudi 29 novembre 2018

Send custom 500 http response from Laravel

I would like to send a custom http response with status as 500. Tried the below code, but it's returning status as 200.

return response()
            ->json([
                'code'      =>  500,
                 'message'   =>  'custom error'
            ], 500);

How can I send http status 500 from laravel controller?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire