@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('preference_user', function (Blueprint $table) { |
|
16 | + Schema::create('preference_user', function(Blueprint $table) { |
|
17 | 17 | $table->id(); |
18 | 18 | $table->unsignedBigInteger('preference_id'); |
19 | 19 | $table->unsignedBigInteger('user_id'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('role_user', function (Blueprint $table) { |
|
16 | + Schema::create('role_user', function(Blueprint $table) { |
|
17 | 17 | $table->bigIncrements('id'); |
18 | 18 | $table->unsignedBigInteger('role_id'); |
19 | 19 | $table->unsignedBigInteger('user_id'); |
@@ -26,9 +26,9 @@ |
||
26 | 26 | </thead> |
27 | 27 | <?php |
28 | 28 | |
29 | -if (! empty($_POST)) { |
|
29 | +if (!empty($_POST)) { |
|
30 | 30 | foreach ($_POST as $key => $value) { |
31 | - if ((! is_string($value) && ! is_numeric($value)) || ! is_string($key)) { |
|
31 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) { |
|
32 | 32 | continue; |
33 | 33 | } |
34 | 34 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * |
8 | 8 | *@return string |
9 | 9 | */ |
10 | -if (! function_exists('adminBaseUrl')) { |
|
10 | +if (!function_exists('adminBaseUrl')) { |
|
11 | 11 | function adminBaseUrl($route) |
12 | 12 | { |
13 | 13 | return url(config('admin.prefix', 'admin').'/'.$route); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | *@return string |
23 | 23 | */ |
24 | -if (! function_exists('adminRedirectRoute')) { |
|
24 | +if (!function_exists('adminRedirectRoute')) { |
|
25 | 25 | function adminRedirectRoute($route) |
26 | 26 | { |
27 | 27 | return adminBaseUrl($route); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | *@return string |
37 | 37 | */ |
38 | -if (! function_exists('adminCreateRoute')) { |
|
38 | +if (!function_exists('adminCreateRoute')) { |
|
39 | 39 | function adminCreateRoute($route) |
40 | 40 | { |
41 | 41 | return adminBaseUrl($route).'/create'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | *@return return_type |
52 | 52 | */ |
53 | -if (! function_exists('adminShowRoute')) { |
|
53 | +if (!function_exists('adminShowRoute')) { |
|
54 | 54 | function adminShowRoute($route, $id) |
55 | 55 | { |
56 | 56 | return adminBaseUrl($route).'/'.$id; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * |
66 | 66 | *@return string |
67 | 67 | */ |
68 | -if (! function_exists('adminEditRoute')) { |
|
68 | +if (!function_exists('adminEditRoute')) { |
|
69 | 69 | function adminEditRoute($route, $id) |
70 | 70 | { |
71 | 71 | return adminBaseUrl($route).'/'.$id.'/edit'; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | *@return string |
81 | 81 | */ |
82 | -if (! function_exists('adminStoreRoute')) { |
|
82 | +if (!function_exists('adminStoreRoute')) { |
|
83 | 83 | function adminStoreRoute($route) |
84 | 84 | { |
85 | 85 | return adminBaseUrl($route); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * |
95 | 95 | *@return string |
96 | 96 | */ |
97 | -if (! function_exists('adminUpdateRoute')) { |
|
97 | +if (!function_exists('adminUpdateRoute')) { |
|
98 | 98 | function adminUpdateRoute($route, $id) |
99 | 99 | { |
100 | 100 | return adminBaseUrl($route).'/'.$id; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | *@return string |
111 | 111 | */ |
112 | -if (! function_exists('adminDeleteRoute')) { |
|
112 | +if (!function_exists('adminDeleteRoute')) { |
|
113 | 113 | function adminDeleteRoute($route, $id) |
114 | 114 | { |
115 | 115 | return adminBaseUrl($route).'/'.$id; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('getClassesList')) { |
|
3 | +if (!function_exists('getClassesList')) { |
|
4 | 4 | function getClassesList($dir) |
5 | 5 | { |
6 | 6 | $classes = \File::allFiles($dir); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | return $classes; |
16 | 16 | } |
17 | 17 | } |
18 | -if (! function_exists('getAllModelNames')) { |
|
18 | +if (!function_exists('getAllModelNames')) { |
|
19 | 19 | function getAllModelNames($dir) |
20 | 20 | { |
21 | 21 | $modelNames = []; |
@@ -29,42 +29,42 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | -if (! function_exists('validImageFolder')) { |
|
32 | +if (!function_exists('validImageFolder')) { |
|
33 | 33 | function validImageFolder($name, $default = 'default') |
34 | 34 | { |
35 | 35 | return strtolower(str_replace([' ', '-', '$', '<', '>', '&', '{', '}', '*', '\\', '/', ':'.';', ',', "'", '"'], '_', $name ?? trim($default))); |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | -if (! function_exists('getImagePlaceholder')) { |
|
39 | +if (!function_exists('getImagePlaceholder')) { |
|
40 | 40 | function getImagePlaceholder() |
41 | 41 | { |
42 | 42 | return asset('adminetic/static/placeholder.png'); |
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
46 | -if (! function_exists('getVerticalImagePlaceholder')) { |
|
46 | +if (!function_exists('getVerticalImagePlaceholder')) { |
|
47 | 47 | function getVerticalImagePlaceholder() |
48 | 48 | { |
49 | 49 | return asset('adminetic/static/vertical_placeholder.jpg'); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | -if (! function_exists('getSliderPlaceholder')) { |
|
53 | +if (!function_exists('getSliderPlaceholder')) { |
|
54 | 54 | function getSliderPlaceholder() |
55 | 55 | { |
56 | 56 | return asset('adminetic/static/slider.jpg'); |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -if (! function_exists('getFoodImagePlaceholder')) { |
|
60 | +if (!function_exists('getFoodImagePlaceholder')) { |
|
61 | 61 | function getFoodImagePlaceholder() |
62 | 62 | { |
63 | 63 | return asset('adminetic/static/food_placeholder.jpg'); |
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | -if (! function_exists('getProfilePlaceholder')) { |
|
67 | +if (!function_exists('getProfilePlaceholder')) { |
|
68 | 68 | function getProfilePlaceholder($p = null) |
69 | 69 | { |
70 | 70 | $profile = $p ?? Auth::user()->profile; |
@@ -73,48 +73,48 @@ discard block |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | -if (! function_exists('getFavicon')) { |
|
76 | +if (!function_exists('getFavicon')) { |
|
77 | 77 | function getFavicon() |
78 | 78 | { |
79 | 79 | return setting('favicon') ? (asset('storage/'.setting('favicon'))) : 'adminetic/static/favicon.png'; |
80 | 80 | } |
81 | 81 | } |
82 | -if (! function_exists('getLogo')) { |
|
82 | +if (!function_exists('getLogo')) { |
|
83 | 83 | function getLogo() |
84 | 84 | { |
85 | 85 | return setting('logo') ? (asset('storage/'.setting('logo'))) : 'adminetic/static/logo.png'; |
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | -if (! function_exists('getLogoBanner')) { |
|
89 | +if (!function_exists('getLogoBanner')) { |
|
90 | 90 | function getLogoBanner() |
91 | 91 | { |
92 | 92 | return setting('logo_banner') ? (asset('storage/'.setting('logo_banner'))) : 'adminetic/static/logo_banner.jpg'; |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -if (! function_exists('getLazyLoadImg')) { |
|
96 | +if (!function_exists('getLazyLoadImg')) { |
|
97 | 97 | function getLazyLoadImg() |
98 | 98 | { |
99 | 99 | return asset('website/assets/images/image-bg.svg'); |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | -if (! function_exists('random_color_part')) { |
|
103 | +if (!function_exists('random_color_part')) { |
|
104 | 104 | function random_color_part() |
105 | 105 | { |
106 | 106 | return str_pad(dechex(mt_rand(0, 255)), 2, '0', STR_PAD_LEFT); |
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | -if (! function_exists('random_color')) { |
|
110 | +if (!function_exists('random_color')) { |
|
111 | 111 | function random_color() |
112 | 112 | { |
113 | 113 | return random_color_part().random_color_part().random_color_part(); |
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | -if (! function_exists('setting')) { |
|
117 | +if (!function_exists('setting')) { |
|
118 | 118 | function setting($setting_name, $default = null) |
119 | 119 | { |
120 | 120 | $valid_setting_name = strtolower(str_replace(' ', '_', $setting_name)); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | -if (! function_exists('preference')) { |
|
127 | +if (!function_exists('preference')) { |
|
128 | 128 | function preference($preference_name, bool $default = null) |
129 | 129 | { |
130 | 130 | $valid_preference_name = strtolower(str_replace(' ', '_', $preference_name)); |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | -if (! function_exists('getCondition')) { |
|
141 | +if (!function_exists('getCondition')) { |
|
142 | 142 | function getCondition($conditions) |
143 | 143 | { |
144 | 144 | $result = null; |
145 | - if (! isset($conditions)) { |
|
145 | + if (!isset($conditions)) { |
|
146 | 146 | return false; |
147 | 147 | } |
148 | 148 |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | * @return callable |
14 | 14 | */ |
15 | 15 | |
16 | - return function ($options = []) { |
|
16 | + return function($options = []) { |
|
17 | 17 | $namespace = "Pratiksh\Adminetic\Http\Controllers"; |
18 | 18 | |
19 | - $this->group(['namespace' => $namespace], function () use ($options) { |
|
19 | + $this->group(['namespace' => $namespace], function() use ($options) { |
|
20 | 20 | // Login Routes... |
21 | 21 | if ($options['login'] ?? true) { |
22 | 22 | $this->get('login', 'Auth\LoginController@showLoginForm')->name('login'); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function resetPassword() |
84 | 84 | { |
85 | - return function () { |
|
85 | + return function() { |
|
86 | 86 | $this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); |
87 | 87 | $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); |
88 | 88 | $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset'); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function confirmPassword() |
99 | 99 | { |
100 | - return function () { |
|
100 | + return function() { |
|
101 | 101 | $this->get('password/confirm', 'Auth\ConfirmPasswordController@showConfirmForm')->name('password.confirm'); |
102 | 102 | $this->post('password/confirm', 'Auth\ConfirmPasswordController@confirm'); |
103 | 103 | }; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function emailVerification() |
112 | 112 | { |
113 | - return function () { |
|
113 | + return function() { |
|
114 | 114 | $this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice'); |
115 | 115 | $this->get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify'); |
116 | 116 | $this->post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend'); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | protected function registerRoutes() |
166 | 166 | { |
167 | - Route::group($this->routeConfiguration(), function () { |
|
167 | + Route::group($this->routeConfiguration(), function() { |
|
168 | 168 | $this->loadRoutesFrom(__DIR__.'/../../routes/web.php'); |
169 | 169 | }); |
170 | 170 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | */ |
209 | 209 | protected function directives() |
210 | 210 | { |
211 | - Blade::if('hasRole', function ($roles) { |
|
211 | + Blade::if ('hasRole', function($roles) { |
|
212 | 212 | $hasAccess = false; |
213 | 213 | $roles_array = explode('|', $roles); |
214 | 214 | foreach ($roles_array as $role) { |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | |
218 | 218 | return $hasAccess; |
219 | 219 | }); |
220 | - Blade::if('preference', function ($preference_name, $default_value) { |
|
220 | + Blade::if ('preference', function($preference_name, $default_value) { |
|
221 | 221 | return preference($preference_name, $default_value); |
222 | 222 | }); |
223 | - Blade::directive('setting', function ($setting_name) { |
|
223 | + Blade::directive('setting', function($setting_name) { |
|
224 | 224 | return "<?php echo setting($setting_name) ?>"; |
225 | 225 | }); |
226 | 226 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function indexPreference() |
16 | 16 | { |
17 | 17 | $preferences = config('coderz.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 | ]); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function indexPermission() |
15 | 15 | { |
16 | 16 | $permissions = config('coderz.caching', true) |
17 | - ? (Cache::has('permissions') ? Cache::get('permissions') : Cache::rememberForever('permissions', function () { |
|
17 | + ? (Cache::has('permissions') ? Cache::get('permissions') : Cache::rememberForever('permissions', function() { |
|
18 | 18 | return Permission::with('role')->get(); |
19 | 19 | })) |
20 | 20 | : Permission::with('role')->get(); |