Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tavobarrientos committed Jan 3, 2019
1 parent 7d4feb2 commit 7a53f44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/PermissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function store(Request $request)

if($permission->save())
{
return new PermissionResource($permission);
return PermissionResource::make($permission);
}

return response()->json(['status' => 403, 'hasError' => false, 'messages' => []], 403);
Expand All @@ -68,7 +68,7 @@ public function store(Request $request)
*/
public function show($id)
{
return new PermissionResource(Permission::find($id));
return PermissionResource::make(Permission::find($id));
}

/**
Expand Down Expand Up @@ -106,7 +106,7 @@ public function update(Request $request, $id)

if($permission->save())
{
return new PermissionResource($permission);
return PermissionResource::make($permission);
}

return response()->json(null, 500);
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Api/RoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function store(Request $request)

if($role->save())
{
return new RoleResource($role);
return RoleResource::make($role);
}

return response()->json(['status' => 403, 'hasError' => false, 'messages' => []], 403);
Expand All @@ -68,7 +68,7 @@ public function store(Request $request)
*/
public function show($id)
{
return new RoleResource(Role::find($id));
return RoleResource::make(Role::find($id));
}

/**
Expand Down Expand Up @@ -106,7 +106,7 @@ public function update(Request $request, $id)

if($role->save())
{
return new RoleResource($role);
return RoleResource::make($role);
}

return response()->json(null, 500);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function update(Request $request, $id)
}
}
$user = User::find($id);
return new UserResource($user);
return UserResource::make($user)->hide(['meta']);
}

return response()->json(null, 500);
Expand Down

0 comments on commit 7a53f44

Please sign in to comment.