@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function onlyTrashed(bool $condition = true) |
| 78 | 78 | { |
| 79 | - return $this->when($condition, function (Builder $q) { |
|
| 79 | + return $this->when($condition, function(Builder $q) { |
|
| 80 | 80 | return $q->onlyTrashed(); |
| 81 | 81 | }); |
| 82 | 82 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | $attributes['password'] = $attributes['password'] ?? Str::random(8); |
| 114 | 114 | |
| 115 | - return tap($this->model()->fill($attributes), function (Administrator $administrator) use ($attributes) { |
|
| 115 | + return tap($this->model()->fill($attributes), function(Administrator $administrator) use ($attributes) { |
|
| 116 | 116 | $administrator->forceFill([ |
| 117 | 117 | 'activated_at' => $attributes['activated_at'] ?? now(), // TODO: Add a setting to change this |
| 118 | 118 | ]); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $roles = $attributes['roles']; |
| 134 | 134 | |
| 135 | - return tap($this->createOne($attributes), function ($administrator) use ($roles) { |
|
| 135 | + return tap($this->createOne($attributes), function($administrator) use ($roles) { |
|
| 136 | 136 | $this->syncRolesByUuids($administrator, $roles); |
| 137 | 137 | }); |
| 138 | 138 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | { |
| 166 | 166 | $roles = $attributes['roles']; |
| 167 | 167 | |
| 168 | - return tap($this->updateOne($administrator, $attributes), function () use ($administrator, $roles) { |
|
| 168 | + return tap($this->updateOne($administrator, $attributes), function() use ($administrator, $roles) { |
|
| 169 | 169 | $this->syncRolesByUuids($administrator, $roles); |
| 170 | 170 | }); |
| 171 | 171 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function onlyTrashed(bool $condition = true) |
| 76 | 76 | { |
| 77 | - return $this->when($condition, function (Builder $query) { |
|
| 77 | + return $this->when($condition, function(Builder $query) { |
|
| 78 | 78 | return $query->onlyTrashed(); |
| 79 | 79 | }); |
| 80 | 80 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $attributes['password'] = Str::random(8); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - return tap($this->model()->fill($attributes), function (User $user) use ($attributes) { |
|
| 114 | + return tap($this->model()->fill($attributes), function(User $user) use ($attributes) { |
|
| 115 | 115 | $user->forceFill([ |
| 116 | 116 | 'uuid' => $attributes['uuid'] ?? Str::uuid(), |
| 117 | 117 | 'activated_at' => $attributes['activated_at'] ?? now(), // TODO: Add a setting to change this |
@@ -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'] ?? []; |
@@ -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 | }); |
@@ -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}"; |