Created
September 14, 2016 05:32
-
-
Save kamaulynder/d8876a2515d37a7cfa6d59d992d3db25 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
| @@ -8,31 +8,39 @@ class EloquentUserRepository implements UserRepository | |
| { | |
| public function all() | |
| { | |
| - return User::all(); | |
| + $users = User::all(); | |
| + | |
| + return $users->toArray(); | |
| } | |
| public function update(array $input, $id) | |
| { | |
| $user = User::findorFail($id); | |
| $user->update($input); | |
| - return $user; | |
| + | |
| + return $user->toArray(); | |
| } | |
| public function create(array $input) | |
| { | |
| - return User::create($input); | |
| + $user = User::create($input); | |
| + | |
| + return $user->toArray(); | |
| } | |
| public function find($id) | |
| { | |
| - return User::find($id); | |
| + $user = User::find($id); | |
| + | |
| + return $user->toArray(); | |
| } | |
| public function delete($id) | |
| { | |
| $user = User::findorFail($id); | |
| $user->delete(); | |
| - return $user; | |
| + | |
| + return $user->toArray(); | |
| } | |
| public function getRoles($id) | |
| (END) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment