If I return an object:
return Response::json([ \'hello\' => $value ]);
the status code will be 200. How can I change it to 201, with
return response(['title' => trans('web.errors.duplicate_title')], 422); //Unprocessable Entity
Hope my answer was helpful.