laravel resource set status code

Solutions on MaxInterview for laravel resource set status code by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "laravel resource set status code"
Valentin
13 Apr 2018
1use App\User;
2use App\Http\Resources\User as UserResource;
3
4Route::get('/user', function () {
5    return (new UserResource(User::find(1)))
6               ->response()
7               ->setStatusCode(200);
8});