diff --git a/app/Http/Controllers/API/UserController.php b/app/Http/Controllers/API/UserController.php index ad7eca5d5..59e9af975 100755 --- a/app/Http/Controllers/API/UserController.php +++ b/app/Http/Controllers/API/UserController.php @@ -75,7 +75,7 @@ class UserController extends BaseController */ public function view(Request $request, $id) { - $query = Models\User::where('id', $id); + $query = Models\User::where((is_numeric($id) ? 'id' : 'email'), $id); if (! is_null($request->input('fields'))) { foreach (explode(',', $request->input('fields')) as $field) {