@@ -59,7 +59,7 @@ |
||
| 59 | 59 | $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'laravel-auth-api'); |
| 60 | 60 | |
| 61 | 61 | // Register the main class to use with the facade |
| 62 | - $this->app->singleton('laravel-auth-api', function () { |
|
| 62 | + $this->app->singleton('laravel-auth-api', function() { |
|
| 63 | 63 | return new LaravelAuthApi; |
| 64 | 64 | }); |
| 65 | 65 | |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public static function bootHasParent() |
| 20 | 20 | { |
| 21 | - static::creating(function ($model) { |
|
| 21 | + static::creating(function($model) { |
|
| 22 | 22 | if ($model->parentHasHasChildrenTrait()) { |
| 23 | 23 | $model->forceFill( |
| 24 | 24 | [$model->getInheritanceColumn() => $model->classToAlias(get_class($model))] |
| 25 | 25 | ); |
| 26 | 26 | } |
| 27 | 27 | }); |
| 28 | - static::addGlobalScope(function ($query) { |
|
| 28 | + static::addGlobalScope(function($query) { |
|
| 29 | 29 | $instance = new static(); |
| 30 | 30 | if ($instance->parentHasHasChildrenTrait()) { |
| 31 | 31 | $query->where($instance->getTable().'.'.$instance->getInheritanceColumn(), $instance->classToAlias(get_class($instance))); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function getTable() |
| 42 | 42 | { |
| 43 | - if (! isset($this->table)) { |
|
| 43 | + if (!isset($this->table)) { |
|
| 44 | 44 | return str_replace('\\', '', Str::snake(Str::plural(class_basename($this->getParentClass())))); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -41,9 +41,9 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function withValidator($validator) |
| 43 | 43 | { |
| 44 | - $validator->after(function ($validator) { |
|
| 44 | + $validator->after(function($validator) { |
|
| 45 | 45 | // check old password matches |
| 46 | - if (! Hash::check($this->input('old_password'), Auth::user()->password)) { |
|
| 46 | + if (!Hash::check($this->input('old_password'), Auth::user()->password)) { |
|
| 47 | 47 | $validator->errors()->add('old_password', 'old password incorrect.'); |
| 48 | 48 | } |
| 49 | 49 | }); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | // if there is no user with that email address create one |
| 30 | 30 | $newUser = false; |
| 31 | - if (! $user) { |
|
| 31 | + if (!$user) { |
|
| 32 | 32 | $user = ApiUser::create($request->only( |
| 33 | 33 | array_merge(['name', 'email'], array_keys(config('laravel-auth-api.extra_columns'))) |
| 34 | 34 | )); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $user = ApiUser::where('email', $this->credentials($request))->first(); |
| 28 | 28 | |
| 29 | 29 | // sent user not found response |
| 30 | - if (! $user) { |
|
| 30 | + if (!$user) { |
|
| 31 | 31 | return $this->sendResetLinkFailedResponse($request, Password::INVALID_USER); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | // will update the password on an actual user model and persist it to the |
| 27 | 27 | // database. Otherwise we will parse the error and return the response. |
| 28 | 28 | $response = $this->broker()->reset( |
| 29 | - $this->credentials($request), function ($user, $password) { |
|
| 29 | + $this->credentials($request), function($user, $password) { |
|
| 30 | 30 | $this->resetPassword($user, $password); |
| 31 | 31 | } |
| 32 | 32 | ); |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | public function hasVerifiedEmail() |
| 13 | 13 | { |
| 14 | - return ! is_null($this->email_verified_at); |
|
| 14 | + return !is_null($this->email_verified_at); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | public function verify(Request $request) |
| 22 | 22 | { |
| 23 | - if (! hash_equals((string) $request->route('code'), (string) hexdec(substr(sha1($request->user()->getKey().$request->user()->getEmailForVerification()), 0, 3)))) { |
|
| 23 | + if (!hash_equals((string) $request->route('code'), (string) hexdec(substr(sha1($request->user()->getKey().$request->user()->getEmailForVerification()), 0, 3)))) { |
|
| 24 | 24 | return ApiResponse::send(['error' => 'Bad codes.'], 0, 403, 'Bad codes.'); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | { |
| 84 | 84 | $stub = str_replace('MedianetDev\LaravelAuthApi\Models;', $this->laravel->getNamespace().'Models;', $stub); |
| 85 | 85 | |
| 86 | - if (! $this->files->exists($this->laravel['path'].'/User.php') && $this->files->exists($this->laravel['path'].'/Models/User.php')) { |
|
| 86 | + if (!$this->files->exists($this->laravel['path'].'/User.php') && $this->files->exists($this->laravel['path'].'/Models/User.php')) { |
|
| 87 | 87 | $stub = str_replace($this->laravel->getNamespace().'User', $this->laravel->getNamespace().'Models\User', $stub); |
| 88 | 88 | } |
| 89 | 89 | |