@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $providers = Auth::config('authentication.socialite.providers', []); |
34 | 34 | |
35 | - return Collection::make($providers)->transform(function (array $provider, string $key) { |
|
35 | + return Collection::make($providers)->transform(function(array $provider, string $key) { |
|
36 | 36 | return new SocialiteProvider(array_merge($provider, ['type' => $key])); |
37 | 37 | }); |
38 | 38 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function getEnabledProviders(): Collection |
46 | 46 | { |
47 | - return static::getProviders()->filter(function (SocialiteProvider $provider) { |
|
47 | + return static::getProviders()->filter(function(SocialiteProvider $provider) { |
|
48 | 48 | return $provider->enabled ?? false; |
49 | 49 | }); |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $options = config("services.{$provider}", []); |
62 | 62 | |
63 | - return tap(static::driver($provider), function (Provider $socialite) use ($provider, $options) { |
|
63 | + return tap(static::driver($provider), function(Provider $socialite) use ($provider, $options) { |
|
64 | 64 | $scopes = $options['scopes'] ?? []; |
65 | 65 | $with = $options['with'] ?? []; |
66 | 66 | $fields = $options['fields'] ?? []; |
@@ -65,14 +65,17 @@ |
||
65 | 65 | $with = $options['with'] ?? []; |
66 | 66 | $fields = $options['fields'] ?? []; |
67 | 67 | |
68 | - if ( ! empty($scopes)) |
|
69 | - $socialite->scopes($scopes); |
|
68 | + if ( ! empty($scopes)) { |
|
69 | + $socialite->scopes($scopes); |
|
70 | + } |
|
70 | 71 | |
71 | - if ( ! empty($with)) |
|
72 | - $socialite->with($with); |
|
72 | + if ( ! empty($with)) { |
|
73 | + $socialite->with($with); |
|
74 | + } |
|
73 | 75 | |
74 | - if ( ! empty($fields)) |
|
75 | - $socialite->fields($fields); |
|
76 | + if ( ! empty($fields)) { |
|
77 | + $socialite->fields($fields); |
|
78 | + } |
|
76 | 79 | })->redirect(); |
77 | 80 | } |
78 | 81 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | */ |
71 | 71 | protected static function defaultCreateUserCallback(): Closure |
72 | 72 | { |
73 | - return function (string $firstName, string $lastName, string $email, string $password) { |
|
73 | + return function(string $firstName, string $lastName, string $email, string $password) { |
|
74 | 74 | /** @var \Arcanesoft\Foundation\Auth\Repositories\UsersRepository $repo */ |
75 | 75 | $repo = app(UsersRepository::class); |
76 | 76 | $now = now(); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | protected static function defaultCreateUserCallback(): Closure |
73 | 73 | { |
74 | - return function (string $firstName, string $lastName, string $email, string $password) { |
|
74 | + return function(string $firstName, string $lastName, string $email, string $password) { |
|
75 | 75 | $repo = static::getAdministratorsRepository(); |
76 | 76 | |
77 | 77 | $administrator = $repo->createOne([ |
@@ -212,7 +212,7 @@ |
||
212 | 212 | return $payload; |
213 | 213 | } |
214 | 214 | |
215 | - return tap($payload, function (&$payload) { |
|
215 | + return tap($payload, function(&$payload) { |
|
216 | 216 | $this->addUserInformation($payload); |
217 | 217 | $this->addRequestInformation($payload); |
218 | 218 | }); |
@@ -98,8 +98,9 @@ discard block |
||
98 | 98 | { |
99 | 99 | $session = $this->findSession($sessionId); |
100 | 100 | |
101 | - if (is_null($session)) |
|
102 | - return ''; |
|
101 | + if (is_null($session)) { |
|
102 | + return ''; |
|
103 | + } |
|
103 | 104 | |
104 | 105 | if ($session->hasExpired()) { |
105 | 106 | $this->exists = true; |
@@ -148,8 +149,7 @@ discard block |
||
148 | 149 | |
149 | 150 | try { |
150 | 151 | return $this->repo->newModelInstance($attributes)->save(); |
151 | - } |
|
152 | - catch (QueryException $e) { |
|
152 | + } catch (QueryException $e) { |
|
153 | 153 | $this->performUpdate($sessionId, $attributes); |
154 | 154 | } |
155 | 155 |
@@ -77,13 +77,13 @@ |
||
77 | 77 | { |
78 | 78 | return $repo |
79 | 79 | ->onlyTrashed($this->trash) |
80 | - ->unless(empty($this->search), function (Builder $query) { |
|
80 | + ->unless(empty($this->search), function(Builder $query) { |
|
81 | 81 | $query |
82 | 82 | ->where('first_name', 'like', '%'.$this->search.'%') |
83 | 83 | ->orWhere('last_name', 'like', '%'.$this->search.'%') |
84 | 84 | ->orWhere('email', 'like', '%'.$this->search.'%'); |
85 | 85 | }) |
86 | - ->unless(empty($this->sortField), function (Builder $query) { |
|
86 | + ->unless(empty($this->sortField), function(Builder $query) { |
|
87 | 87 | $query->orderBy($this->sortField, $this->getSortDirection()); |
88 | 88 | }) |
89 | 89 | ->paginate($this->perPage); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function render(PasswordResetsRepository $repo) |
60 | 60 | { |
61 | - return view('foundation::authorization.password-resets._datatables.index',[ |
|
61 | + return view('foundation::authorization.password-resets._datatables.index', [ |
|
62 | 62 | 'passwordResets' => $this->getResults($repo), |
63 | 63 | 'fields' => $this->getFields(), |
64 | 64 | ]); |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | private function getResults(PasswordResetsRepository $repo): LengthAwarePaginator |
75 | 75 | { |
76 | 76 | return $repo |
77 | - ->unless(empty($this->search), function (Builder $query) { |
|
77 | + ->unless(empty($this->search), function(Builder $query) { |
|
78 | 78 | $query->Where('email', 'like', '%'.$this->search.'%'); |
79 | 79 | }) |
80 | - ->unless(empty($this->sortField), function (Builder $query) { |
|
80 | + ->unless(empty($this->sortField), function(Builder $query) { |
|
81 | 81 | $query->orderBy($this->sortField, $this->getSortDirection()); |
82 | 82 | }) |
83 | 83 | ->paginate($this->perPage); |
@@ -81,13 +81,13 @@ |
||
81 | 81 | ->with(['group']) |
82 | 82 | ->withCount(['roles']) |
83 | 83 | ->join($groupsTable, "{$permissionTable}.group_id", '=', "{$groupsTable}.id") |
84 | - ->unless(empty($this->search), function (Builder $query) use ($permissionTable, $groupsTable) { |
|
84 | + ->unless(empty($this->search), function(Builder $query) use ($permissionTable, $groupsTable) { |
|
85 | 85 | $query |
86 | 86 | ->where("{$groupsTable}.name", 'like', '%'.$this->search.'%') |
87 | 87 | ->orWhere("{$permissionTable}.category", 'like', '%'.$this->search.'%') |
88 | 88 | ->orWhere("{$permissionTable}.name", 'like', '%'.$this->search.'%'); |
89 | 89 | }) |
90 | - ->unless(empty($this->sortField), function (Builder $query) use ($permissionTable, $groupsTable) { |
|
90 | + ->unless(empty($this->sortField), function(Builder $query) use ($permissionTable, $groupsTable) { |
|
91 | 91 | $sortField = $this->sortField === 'group' |
92 | 92 | ? "{$groupsTable}.name" |
93 | 93 | : "{$permissionTable}.{$this->sortField}"; |
@@ -75,10 +75,10 @@ |
||
75 | 75 | { |
76 | 76 | return $repo |
77 | 77 | ->withCount(['administrators']) |
78 | - ->unless(empty($this->search), function (Builder $query) { |
|
78 | + ->unless(empty($this->search), function(Builder $query) { |
|
79 | 79 | $query->where('name', 'like', '%'.$this->search.'%'); |
80 | 80 | }) |
81 | - ->unless(empty($this->sortField), function (Builder $query) { |
|
81 | + ->unless(empty($this->sortField), function(Builder $query) { |
|
82 | 82 | $query->orderBy($this->sortField, $this->getSortDirection()); |
83 | 83 | }) |
84 | 84 | ->paginate($this->perPage); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | public function getUsersCountAttribute(): int |
32 | 32 | { |
33 | - return $this->roles->sum(function (Role $role) { |
|
33 | + return $this->roles->sum(function(Role $role) { |
|
34 | 34 | return $role->administrators->count(); |
35 | 35 | }); |
36 | 36 | } |