@@ -13,7 +13,7 @@ |
||
13 | 13 | public function indexRole() |
14 | 14 | { |
15 | 15 | $roles = config('adminetic.caching', true) |
16 | - ? (Cache::has('roles') ? Cache::get('roles') : Cache::rememberForever('roles', function () { |
|
16 | + ? (Cache::has('roles') ? Cache::get('roles') : Cache::rememberForever('roles', function() { |
|
17 | 17 | return Role::all(); |
18 | 18 | })) |
19 | 19 | : Role::all(); |
@@ -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 | ]); |
@@ -47,14 +47,14 @@ |
||
47 | 47 | case 2: |
48 | 48 | $this->resetPage(); |
49 | 49 | $search = $this->search ?? null; |
50 | - $data = $default->where('name', 'like', '%' . $search . '%') |
|
51 | - ->orWhere('email', 'like', '%' . $search . '%'); |
|
52 | - $this->information = 'Showing search results for "' . $search . '"'; |
|
50 | + $data = $default->where('name', 'like', '%'.$search.'%') |
|
51 | + ->orWhere('email', 'like', '%'.$search.'%'); |
|
52 | + $this->information = 'Showing search results for "'.$search.'"'; |
|
53 | 53 | break; |
54 | 54 | case 3: |
55 | 55 | $this->resetPage(); |
56 | 56 | $role_id = $this->role ?? null; |
57 | - $data = $role_id == '' ? $default : $default->whereHas('roles', function ($query) use ($role_id) { |
|
57 | + $data = $role_id == '' ? $default : $default->whereHas('roles', function($query) use ($role_id) { |
|
58 | 58 | $query->where('role_id', $role_id); |
59 | 59 | }); |
60 | 60 | break; |
@@ -89,7 +89,7 @@ |
||
89 | 89 | 'profile_pic' => $this->profile_pic->store('admin/user', 'public'), |
90 | 90 | ]); |
91 | 91 | $image = Image::make($this->profile_pic->getRealPath()); |
92 | - $image->save(public_path('storage/' . $profile->profile_pic)); |
|
92 | + $image->save(public_path('storage/'.$profile->profile_pic)); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 |
@@ -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 | |
@@ -68,13 +68,13 @@ discard block |
||
68 | 68 | ], |
69 | 69 | self::getStub('Api/Restful/RestAPIController') |
70 | 70 | ); |
71 | - file_put_contents(app_path("/Http/Controllers/Api/" . trim($version) . "/Restful/{$name}RestAPIController.php"), $controllerTemplate); |
|
71 | + file_put_contents(app_path("/Http/Controllers/Api/".trim($version)."/Restful/{$name}RestAPIController.php"), $controllerTemplate); |
|
72 | 72 | |
73 | 73 | $route = strtolower($name); |
74 | - file_put_contents('routes/api.php', "\n", FILE_APPEND | LOCK_EX); |
|
75 | - file_put_contents('routes/api.php', "Route::get('{$route}/all',[{$name}RestAPIController::class,'all'])->name('{$route}.all'); \n", FILE_APPEND | LOCK_EX); |
|
76 | - file_put_contents('routes/api.php', "Route::post('{$route}/get',[{$name}RestAPIController::class,'get'])->name('{$route}.get'); \n", FILE_APPEND | LOCK_EX); |
|
77 | - file_put_contents('routes/api.php', "Route::apiResource('{$route}',{$name}RestAPIController::class); \n", FILE_APPEND | LOCK_EX); |
|
74 | + file_put_contents('routes/api.php', "\n", FILE_APPEND | LOCK_EX); |
|
75 | + file_put_contents('routes/api.php', "Route::get('{$route}/all',[{$name}RestAPIController::class,'all'])->name('{$route}.all'); \n", FILE_APPEND | LOCK_EX); |
|
76 | + file_put_contents('routes/api.php', "Route::post('{$route}/get',[{$name}RestAPIController::class,'get'])->name('{$route}.get'); \n", FILE_APPEND | LOCK_EX); |
|
77 | + file_put_contents('routes/api.php', "Route::apiResource('{$route}',{$name}RestAPIController::class); \n", FILE_APPEND | LOCK_EX); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -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( |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ], |
110 | 110 | self::getStub('Api/Client/ClientAPIController') |
111 | 111 | ); |
112 | - file_put_contents(app_path("/Http/Controllers/Api/" . trim($version) . "/Client/{$name}ClientAPIController.php"), $controllerTemplate); |
|
112 | + file_put_contents(app_path("/Http/Controllers/Api/".trim($version)."/Client/{$name}ClientAPIController.php"), $controllerTemplate); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected static function makeAPIResource($name, $path, $version) |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | $table = strtolower(Str::plural($name)); |
169 | 169 | |
170 | - $columns = DB::select(DB::raw('SHOW COLUMNS FROM `' . $table . '`')); |
|
170 | + $columns = DB::select(DB::raw('SHOW COLUMNS FROM `'.$table.'`')); |
|
171 | 171 | |
172 | 172 | $fields = []; |
173 | 173 | |
@@ -184,14 +184,14 @@ discard block |
||
184 | 184 | $example = DB::table($table)->count() > 0 ? DB::table($table)->first()->$field_name : ''; |
185 | 185 | if (!in_array($field_name, ['created_at', 'updated_at']) && !in_array($field_type, ['longtext'])) { |
186 | 186 | if ($null != "No") { |
187 | - $required_fields[] = '"' . $field_name . '"'; |
|
187 | + $required_fields[] = '"'.$field_name.'"'; |
|
188 | 188 | } |
189 | 189 | $fields[] = [ |
190 | 190 | 'field_name' => $field_name, |
191 | 191 | 'field_type' => $field_type, |
192 | 192 | 'field_default' => $field_default, |
193 | 193 | ]; |
194 | - $swagger_json_content[] = '@OA\Property(property="' . $field_name . '",nullable=' . $null . ',type="' . $field_type . '",default="' . $field_default . '",example="' . $example . '")'; |
|
194 | + $swagger_json_content[] = '@OA\Property(property="'.$field_name.'",nullable='.$null.',type="'.$field_type.'",default="'.$field_default.'",example="'.$example.'")'; |
|
195 | 195 | } |
196 | 196 | } |
197 | 197 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function index() |
10 | 10 | { |
11 | - $file_path = public_path() . '/adminetic/assets/js/icon-picker/iconpicker-1.5.0.json'; |
|
11 | + $file_path = public_path().'/adminetic/assets/js/icon-picker/iconpicker-1.5.0.json'; |
|
12 | 12 | $fonts = file_exists($file_path) ? json_decode(file_get_contents($file_path), true) : null; |
13 | 13 | |
14 | 14 | return view('adminetic::admin.fontawesome.index', compact('fonts')); |
@@ -76,17 +76,17 @@ discard block |
||
76 | 76 | public $audiance; |
77 | 77 | |
78 | 78 | // Notification Display Setting |
79 | - public $allow_dismiss = true; |
|
80 | - public $newest_on_top = true; |
|
81 | - public $mouse_over = false; |
|
82 | - public $showProgressbar = false; |
|
83 | - public $spacing = 10; |
|
84 | - public $timer = 8000; |
|
85 | - public $placement_from = 'bottom'; |
|
86 | - public $placement_align = 'right'; |
|
87 | - public $delay = 1000; |
|
88 | - public $animate_enter = 'bounceIn'; |
|
89 | - public $animate_exit = 'rubberBand'; |
|
79 | + public $allow_dismiss = true; |
|
80 | + public $newest_on_top = true; |
|
81 | + public $mouse_over = false; |
|
82 | + public $showProgressbar = false; |
|
83 | + public $spacing = 10; |
|
84 | + public $timer = 8000; |
|
85 | + public $placement_from = 'bottom'; |
|
86 | + public $placement_align = 'right'; |
|
87 | + public $delay = 1000; |
|
88 | + public $animate_enter = 'bounceIn'; |
|
89 | + public $animate_exit = 'rubberBand'; |
|
90 | 90 | /** |
91 | 91 | * Create a new notification instance. |
92 | 92 | * |
@@ -111,19 +111,19 @@ discard block |
||
111 | 111 | $this->audiance = $data['audiance'] ?? null; |
112 | 112 | |
113 | 113 | // Notification Display Setting |
114 | - $this->allow_dismiss = $data['allow_dismiss'] ?? true; |
|
115 | - $this->newest_on_top = $data['newest_on_top'] ?? true; |
|
116 | - $this->mouse_over = $data['mouse_over'] ?? false; |
|
117 | - $this->showProgressbar = $data['showProgressbar'] ?? false; |
|
118 | - $this->spacing = $data['spacing'] ?? 10; |
|
119 | - $this->timer = $data['timer'] ?? 8000; |
|
120 | - $this->placement_from = $data['placement_from'] ?? 'bottom'; |
|
121 | - $this->placement_align = $data['placement_align'] ?? 'right'; |
|
114 | + $this->allow_dismiss = $data['allow_dismiss'] ?? true; |
|
115 | + $this->newest_on_top = $data['newest_on_top'] ?? true; |
|
116 | + $this->mouse_over = $data['mouse_over'] ?? false; |
|
117 | + $this->showProgressbar = $data['showProgressbar'] ?? false; |
|
118 | + $this->spacing = $data['spacing'] ?? 10; |
|
119 | + $this->timer = $data['timer'] ?? 8000; |
|
120 | + $this->placement_from = $data['placement_from'] ?? 'bottom'; |
|
121 | + $this->placement_align = $data['placement_align'] ?? 'right'; |
|
122 | 122 | $this->delay = $data['delay'] ?? 1000; |
123 | - $this->animate_enter = $data['animate_enter'] ?? 'bounceIn'; |
|
124 | - $this->animate_exit = $data['animate_exit'] ?? 'rubberBand'; |
|
123 | + $this->animate_enter = $data['animate_enter'] ?? 'bounceIn'; |
|
124 | + $this->animate_exit = $data['animate_exit'] ?? 'rubberBand'; |
|
125 | 125 | |
126 | - $this->subject = $data['subject'] ?? (($this->action ?? 'General') . ' Notification : ' . $this->title); |
|
126 | + $this->subject = $data['subject'] ?? (($this->action ?? 'General').' Notification : '.$this->title); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | ->subject($this->subject) |
150 | 150 | ->line($this->subject) |
151 | 151 | ->line($this->message) |
152 | - ->line('From ' . title()); |
|
152 | + ->line('From '.title()); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -281,7 +281,9 @@ |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | $str = substr($str, 0, -1); |
284 | - if (!file_put_contents($envFile, $str)) return false; |
|
284 | + if (!file_put_contents($envFile, $str)) { |
|
285 | + return false; |
|
286 | + } |
|
285 | 287 | return true; |
286 | 288 | } |
287 | 289 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | $profile = $p ?? Auth::user()->profile ?? Auth::user()->profile()->create(); |
82 | 82 | |
83 | - return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/' . $profile->profile_pic)) : asset('adminetic/static/profile.gif'); |
|
83 | + return isset($profile->profile_pic) ? (Illuminate\Support\Str::contains($profile->profile_pic, ['https://', 'http://']) ? $profile->profile_pic : asset('storage/'.$profile->profile_pic)) : asset('adminetic/static/profile.gif'); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if (!function_exists('random_color')) { |
151 | 151 | function random_color() |
152 | 152 | { |
153 | - return random_color_part() . random_color_part() . random_color_part(); |
|
153 | + return random_color_part().random_color_part().random_color_part(); |
|
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if (!function_exists('deleteImage')) { |
182 | 182 | function deleteImage($image) |
183 | 183 | { |
184 | - $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/' . $image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/' . $image)) : '') : ''; |
|
184 | + $image ? (\Illuminate\Support\Facades\File::exists(public_path('storage/'.$image)) ? \Illuminate\Support\Facades\File::delete(public_path('storage/'.$image)) : '') : ''; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | function getImg($img, $default) |
241 | 241 | { |
242 | 242 | if (isset($img)) { |
243 | - if (file_exists(public_path('storage/' . $img))) { |
|
244 | - return asset('storage/' . $img); |
|
243 | + if (file_exists(public_path('storage/'.$img))) { |
|
244 | + return asset('storage/'.$img); |
|
245 | 245 | } elseif (file_exists(public_path($img))) { |
246 | 246 | return asset($img); |
247 | 247 | } else { |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | if (!function_exists('putContentToClassFunction')) { |
257 | 257 | function putContentToClassFunction($file, $function_name, $data, $closing_token = "}") |
258 | 258 | { |
259 | - $data = $data . "\n"; |
|
259 | + $data = $data."\n"; |
|
260 | 260 | // Read the contents of the file into a string |
261 | 261 | $contents = file_get_contents($file); |
262 | 262 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $function_definition = substr($contents, $start_pos, $end_pos - $start_pos + 1); |
277 | 277 | |
278 | 278 | // Append the new content to the function definition |
279 | - $modified_function_definition = rtrim($function_definition, $closing_token) . $data . $closing_token; |
|
279 | + $modified_function_definition = rtrim($function_definition, $closing_token).$data.$closing_token; |
|
280 | 280 | |
281 | 281 | // Replace the original function definition with the modified one in the class definition |
282 | 282 | $modified_contents = substr_replace($contents, $modified_function_definition, $start_pos, $end_pos - $start_pos + 1); |