@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function authenticate(Request $request) |
| 22 | 22 | { |
| 23 | 23 | try { |
| 24 | - if (! $token = $this->auth->attempt($request->only('email', 'password'))) { |
|
| 24 | + if (!$token = $this->auth->attempt($request->only('email', 'password'))) { |
|
| 25 | 25 | return response()->json([ |
| 26 | 26 | 'error' => 'invalid_credentials', |
| 27 | 27 | ], 401); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $data = $request->all(); |
| 41 | 41 | |
| 42 | - if (! array_key_exists('password_confirmation', $request->all())) { |
|
| 42 | + if (!array_key_exists('password_confirmation', $request->all())) { |
|
| 43 | 43 | $data['password_confirmation'] = $request->get('password'); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function byId($id) |
| 48 | 48 | { |
| 49 | - if (! is_null($user = $this->auth->findUserById($id))) { |
|
| 49 | + if (!is_null($user = $this->auth->findUserById($id))) { |
|
| 50 | 50 | $this->auth->setUser($user); |
| 51 | 51 | |
| 52 | 52 | return true; |
@@ -47,8 +47,8 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | protected function registerRequestRebindHandler() |
| 49 | 49 | { |
| 50 | - $this->app->rebinding('request', function ($app, $request) { |
|
| 51 | - $request->setUserResolver(function () use ($app) { |
|
| 50 | + $this->app->rebinding('request', function($app, $request) { |
|
| 51 | + $request->setUserResolver(function() use ($app) { |
|
| 52 | 52 | return $app['user.auth']->getUser(); |
| 53 | 53 | }); |
| 54 | 54 | }); |
@@ -2,12 +2,12 @@ |
||
| 2 | 2 | |
| 3 | 3 | $api = app('Dingo\Api\Routing\Router'); |
| 4 | 4 | |
| 5 | -$api->version('v1', function ($api) { |
|
| 5 | +$api->version('v1', function($api) { |
|
| 6 | 6 | $api->post('auth/login', 'Autumn\JWTAuth\Http\Controllers\AuthController@authenticate'); |
| 7 | 7 | $api->post('auth/register', 'Autumn\JWTAuth\Http\Controllers\AuthController@register'); |
| 8 | 8 | $api->post('auth/logout', 'Autumn\JWTAuth\Http\Controllers\AuthController@logout'); |
| 9 | 9 | |
| 10 | - $api->group(['middleware' => 'jwt.auth'], function ($api) { |
|
| 10 | + $api->group(['middleware' => 'jwt.auth'], function($api) { |
|
| 11 | 11 | $api->get('auth/me', 'Autumn\JWTAuth\Http\Controllers\AuthController@user'); |
| 12 | 12 | }); |
| 13 | 13 | }); |