@@ -52,8 +52,8 @@ |
||
52 | 52 | public function scopeVisible($query) |
53 | 53 | { |
54 | 54 | return $query->when( |
55 | - ! Auth::user()->belongsToAdminGroup(), |
|
56 | - fn ($query) => $query->whereId(Auth::user()->group_id) |
|
55 | + !Auth::user()->belongsToAdminGroup(), |
|
56 | + fn($query) => $query->whereId(Auth::user()->group_id) |
|
57 | 57 | ); |
58 | 58 | } |
59 | 59 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | public function store(UploadedFile $file) |
62 | 62 | { |
63 | - return DB::transaction(function () use ($file) { |
|
63 | + return DB::transaction(function() use ($file) { |
|
64 | 64 | $this->delete(); |
65 | 65 | $avatar = self::create(['user_id' => Auth::user()->id]); |
66 | 66 |
@@ -56,9 +56,9 @@ |
||
56 | 56 | { |
57 | 57 | $fromAdminGroup = Auth::user()->belongsToAdminGroup(); |
58 | 58 | |
59 | - return $query->when(! $fromAdminGroup, fn ($query) => $query->whereHas( |
|
59 | + return $query->when(!$fromAdminGroup, fn($query) => $query->whereHas( |
|
60 | 60 | 'userGroups', |
61 | - fn ($groups) => $groups->whereId(Auth::user()->group_id) |
|
61 | + fn($groups) => $groups->whereId(Auth::user()->group_id) |
|
62 | 62 | )); |
63 | 63 | } |
64 | 64 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | protected $hidden = ['password', 'remember_token', 'password_updated_at']; |
46 | 46 | |
47 | - protected $fillable = ['person_id', 'group_id', 'role_id', 'email', 'is_active','email_verified_at','password']; |
|
47 | + protected $fillable = ['person_id', 'group_id', 'role_id', 'email', 'is_active', 'email_verified_at', 'password']; |
|
48 | 48 | |
49 | 49 | protected $casts = [ |
50 | 50 | 'is_active' => 'boolean', 'person_id' => 'int', 'group_id' => 'int', 'role_id' => 'int', |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function erase(bool $person = false) |
163 | 163 | { |
164 | 164 | if ($person) { |
165 | - return DB::transaction(fn () => tap($this)->delete()->person->delete()); |
|
165 | + return DB::transaction(fn() => tap($this)->delete()->person->delete()); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $this->delete(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | if (App::environment('testing')) { |
56 | 56 | $directory = Config::get('enso.files.testingFolder'); |
57 | 57 | |
58 | - if (! Storage::has($directory)) { |
|
58 | + if (!Storage::has($directory)) { |
|
59 | 59 | Storage::makeDirectory($directory); |
60 | 60 | } |
61 | 61 | |
@@ -102,6 +102,6 @@ discard block |
||
102 | 102 | |
103 | 103 | protected static function bootHasFile() |
104 | 104 | { |
105 | - self::deleting(fn ($model) => (new Files($model))->delete()); |
|
105 | + self::deleting(fn($model) => (new Files($model))->delete()); |
|
106 | 106 | } |
107 | 107 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public static function bootHasAvatar() |
11 | 11 | { |
12 | - self::created(fn ($model) => $model->generateAvatar()); |
|
12 | + self::created(fn($model) => $model->generateAvatar()); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | public function avatar() |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | // add birthyear to person table ( for form builder ) |
122 | - if ($title == 'BIRT' && ! empty($date)) { |
|
122 | + if ($title == 'BIRT' && !empty($date)) { |
|
123 | 123 | $this->birthday = date('Y-m-d', strtotime($date)); |
124 | 124 | } |
125 | 125 | // add deathyear to person table ( for form builder ) |
126 | - if ($title == 'DEAT' && ! empty($date)) { |
|
126 | + if ($title == 'DEAT' && !empty($date)) { |
|
127 | 127 | $this->deathday = date('Y-m-d', strtotime($date)); |
128 | 128 | } |
129 | 129 | $this->save(); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | public function gender() |
173 | 173 | { |
174 | - if (! $this->title) { |
|
174 | + if (!$this->title) { |
|
175 | 175 | return; |
176 | 176 | } |
177 | 177 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | public function syncCompanies($companyIds, $mainCompanyId) |
191 | 191 | { |
192 | 192 | $pivotIds = (new Collection($companyIds)) |
193 | - ->reduce(fn ($pivot, $value) => $pivot->put($value, [ |
|
193 | + ->reduce(fn($pivot, $value) => $pivot->put($value, [ |
|
194 | 194 | 'is_main' => $value === $mainCompanyId, |
195 | 195 | 'is_mandatary' => false, |
196 | 196 | ]), new Collection()); |