Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel resource set status code

use AppUser;
use AppHttpResourcesUser as UserResource;

Route::get('/user', function () {
    return (new UserResource(User::find(1)))
               ->response()
               ->setStatusCode(200);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #resource #set #status #code
ADD COMMENT
Topic
Name
1+2 =