Created
September 26, 2017 19:08
-
-
Save deleugpn/e1907ecd1fe80b174a7a253bbf959d02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use App\Http\Resources\UsersResource; | |
| use App\User; | |
| class UsersController extends Controller | |
| { | |
| /** | |
| * Display a listing of the resource. | |
| * | |
| * @param User $user | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function index(User $user) | |
| { | |
| return UsersResource::collection($user->paginate())->hide(['id', 'email']); | |
| } | |
| /** | |
| * Display a user. | |
| * | |
| * @param User $user | |
| * @return \Illuminate\Http\Response | |
| */ | |
| public function show(User $user) | |
| { | |
| return UsersResource::make($user)->hide(['id']); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment