@@ -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) { |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | $exclude_website_models = getAllModelNames(app_path('Models/Admin/Website')); |
| 47 | 47 | $models = getAllModelNames(app_path($path)); |
| 48 | 48 | foreach ($models as $name) { |
| 49 | - if (Schema::hasTable(Str::plural($name)) && ! in_array($name, $excluded_models ?? []) && ! in_array($name, $exclude_website_models ?? [])) { |
|
| 49 | + if (Schema::hasTable(Str::plural($name)) && !in_array($name, $excluded_models ?? []) && !in_array($name, $exclude_website_models ?? [])) { |
|
| 50 | 50 | $path = $this->getModelPath($name); |
| 51 | 51 | $version = $this->option('v'); |
| 52 | 52 | if ($this->option('rest')) { |
@@ -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() |