@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function indexPreference() |
16 | 16 | { |
17 | 17 | $preferences = config('adminetic.caching', true) |
18 | - ? (Cache::has('preferences') ? Cache::get('preferences') : Cache::rememberForever('preferences', function () { |
|
18 | + ? (Cache::has('preferences') ? Cache::get('preferences') : Cache::rememberForever('preferences', function() { |
|
19 | 19 | return Preference::latest()->get(); |
20 | 20 | })) |
21 | 21 | : Preference::latest()->get(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $users = User::all(); |
40 | 40 | if (isset($users)) { |
41 | 41 | foreach ($users as $user) { |
42 | - if (! isset($preference->roles)) { |
|
42 | + if (!isset($preference->roles)) { |
|
43 | 43 | $preference->users()->attach($user->id, [ |
44 | 44 | 'enabled' => $preference->active, |
45 | 45 | ]); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | $preferences = Preference::all(); |
91 | 91 | if (isset($preferences)) { |
92 | 92 | foreach ($preferences as $preference) { |
93 | - if (! isset($preference->roles)) { |
|
93 | + if (!isset($preference->roles)) { |
|
94 | 94 | $user->preferences()->attach($preference->id, [ |
95 | 95 | 'enabled' => $preference->active, |
96 | 96 | ]); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | case 3: |
56 | 56 | $this->resetPage(); |
57 | 57 | $role_id = $this->role ?? null; |
58 | - $data = $role_id == '' ? $default : $default->whereHas('roles', function ($query) use ($role_id) { |
|
58 | + $data = $role_id == '' ? $default : $default->whereHas('roles', function($query) use ($role_id) { |
|
59 | 59 | $query->where('role_id', $role_id); |
60 | 60 | }); |
61 | 61 | break; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | if (auth()->user()->isSuperAdmin()) { |
20 | 20 | return $next($request); |
21 | - } elseif (! in_array(url()->current(), session()->get('verified_routes') ?? [])) { |
|
21 | + } elseif (!in_array(url()->current(), session()->get('verified_routes') ?? [])) { |
|
22 | 22 | session()->put('destination_password', $password); |
23 | 23 | session()->put('destination_route', url()->current()); |
24 | 24 | session()->put('destination_route_name', $request->route()->getName()); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $version_lc = strtolower($version); |
39 | 39 | $swagger_json_content = self::generateSwaggerJsonContentContent($name)['content']; |
40 | 40 | $required_fields = self::generateSwaggerJsonContentContent($name)['required_fields']; |
41 | - if (! file_exists($dir_path = app_path('Http/Controllers/Api/'.trim($version).'/Restful'))) { |
|
41 | + if (!file_exists($dir_path = app_path('Http/Controllers/Api/'.trim($version).'/Restful'))) { |
|
42 | 42 | mkdir($dir_path, 0777, true); |
43 | 43 | } |
44 | 44 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | // Making API Resource |
88 | 88 | self::makeAPIResource($name, $path, $version); |
89 | 89 | // Making Controller |
90 | - if (! file_exists($dir_path = app_path('Http/Controllers/Api/'.trim($version).'/Client'))) { |
|
90 | + if (!file_exists($dir_path = app_path('Http/Controllers/Api/'.trim($version).'/Client'))) { |
|
91 | 91 | mkdir($dir_path, 0777, true); |
92 | 92 | } |
93 | 93 | $controllerTemplate = str_replace( |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | $version = ucfirst($version); |
118 | 118 | $version_lc = strtolower($version); |
119 | - if (! file_exists($dir_path = app_path("/Http/Resources/{$version}/{$name}"))) { |
|
119 | + if (!file_exists($dir_path = app_path("/Http/Resources/{$version}/{$name}"))) { |
|
120 | 120 | mkdir($dir_path, 0777, true); |
121 | 121 | } |
122 | 122 | // Making Collection |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | $swagger_json_content = []; |
176 | 176 | |
177 | 177 | foreach ($columns as $column) { |
178 | - if (! is_null($column)) { |
|
178 | + if (!is_null($column)) { |
|
179 | 179 | $null = $column->Null == 'No' ? 'true' : 'false'; |
180 | 180 | $field_name = $column->Field; |
181 | 181 | $field_type = $column->Type; |
182 | 182 | $field_default = $column->Default; |
183 | 183 | $example = DB::table($table)->count() > 0 ? DB::table($table)->first()->$field_name : ''; |
184 | - if (! in_array($field_name, ['created_at', 'updated_at']) && ! in_array($field_type, ['longtext'])) { |
|
184 | + if (!in_array($field_name, ['created_at', 'updated_at']) && !in_array($field_type, ['longtext'])) { |
|
185 | 185 | if ($null != 'No') { |
186 | 186 | $required_fields[] = '"'.$field_name.'"'; |
187 | 187 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function scopeSearch(Builder $builder, string $term = '') |
10 | 10 | { |
11 | - if (! $this->searchable) { |
|
11 | + if (!$this->searchable) { |
|
12 | 12 | throw new Exception('Please define the searchable property . '); |
13 | 13 | } |
14 | 14 | foreach ($this->searchable as $searchable) { |
@@ -40,7 +40,7 @@ |
||
40 | 40 | 'message' => $error, |
41 | 41 | ]; |
42 | 42 | |
43 | - if (! empty($errorMessages)) { |
|
43 | + if (!empty($errorMessages)) { |
|
44 | 44 | $response['data'] = $errorMessages; |
45 | 45 | } |
46 | 46 |
@@ -25,10 +25,10 @@ |
||
25 | 25 | |
26 | 26 | public function preferenceChanged(User $user, Preference $preference) |
27 | 27 | { |
28 | - $user->preferences()->updateExistingPivot($preference->id, ['enabled' => ! $this->enabled], false); |
|
28 | + $user->preferences()->updateExistingPivot($preference->id, ['enabled' => !$this->enabled], false); |
|
29 | 29 | |
30 | 30 | $this->preference = $preference; |
31 | - $this->enabled = ! $this->enabled; |
|
31 | + $this->enabled = !$this->enabled; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function render() |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function deleteWithLimit() |
55 | 55 | { |
56 | - if (! is_null($this->delete_limit)) { |
|
56 | + if (!is_null($this->delete_limit)) { |
|
57 | 57 | Activity::whereDate('created_at', '<', Carbon::now()->subDays($this->delete_limit))->delete(); |
58 | 58 | $this->emit('activity_success', 'All activities Deleted except last '.$this->delete_limit.'days activities'); |
59 | 59 | } |
@@ -97,19 +97,19 @@ discard block |
||
97 | 97 | $this->resetPage(); |
98 | 98 | $data = Activity::query(); |
99 | 99 | // Filter By Log Name |
100 | - if (! is_null($this->log_name)) { |
|
100 | + if (!is_null($this->log_name)) { |
|
101 | 101 | $data = $data->where('log_name', $this->log_name); |
102 | 102 | } |
103 | 103 | // Filter By Model |
104 | - if (! is_null($this->model)) { |
|
104 | + if (!is_null($this->model)) { |
|
105 | 105 | $data = $data->where('subject_type', $this->model); |
106 | 106 | } |
107 | 107 | // Filter By User |
108 | - if (! is_null($this->user_id)) { |
|
108 | + if (!is_null($this->user_id)) { |
|
109 | 109 | $data = $data->where('causer_id', $this->user_id); |
110 | 110 | } |
111 | 111 | // Filter By Date |
112 | - if (! is_null($this->start_date) && ! is_null($this->end_date)) { |
|
112 | + if (!is_null($this->start_date) && !is_null($this->end_date)) { |
|
113 | 113 | $data = $data->whereDate('created_at', [$this->start_date, $this->end_date]); |
114 | 114 | } |
115 | 115 | $this->activity_count = with($data)->count(); |