@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | Navigation::create([ |
| 29 | 29 | 'name' => $request->get('name'), |
| 30 | 30 | 'slug' => $request->get('slug'), |
| 31 | - 'icon' => (string) $request->get('icon'), |
|
| 32 | - 'is_active' => (bool) $request->get('is_active'), |
|
| 31 | + 'icon' => (string)$request->get('icon'), |
|
| 32 | + 'is_active' => (bool)$request->get('is_active'), |
|
| 33 | 33 | ])->makeChildOf($root); |
| 34 | 34 | |
| 35 | 35 | Navigation::rebuild(); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | Navigation::find($request->get('id'))->update([ |
| 43 | 43 | 'name' => $request->get('name'), |
| 44 | 44 | 'slug' => $request->get('slug'), |
| 45 | - 'icon' => (string) $request->get('icon'), |
|
| 46 | - 'is_active' => (bool) $request->get('is_active'), |
|
| 45 | + 'icon' => (string)$request->get('icon'), |
|
| 46 | + 'is_active' => (bool)$request->get('is_active'), |
|
| 47 | 47 | ]); |
| 48 | 48 | |
| 49 | 49 | return redirect()->back(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function login(LoginRequest $request) |
| 51 | 51 | { |
| 52 | 52 | $credentials = $this->getAuthCredentials($request); |
| 53 | - $shouldRemember = (bool) $request->get('remember'); |
|
| 53 | + $shouldRemember = (bool)$request->get('remember'); |
|
| 54 | 54 | if (Auth::guard(admin_user_guard())->attempt($credentials, $shouldRemember)) { |
| 55 | 55 | if ($this->isValidOTP(admin_user(), $request->get('otp'))) { |
| 56 | 56 | event(new LoginSuccess(admin_user())); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | private function shouldOTP(): bool |
| 130 | 130 | { |
| 131 | - return (bool) config('jarboe.admin_panel.two_factor_auth.enabled'); |
|
| 131 | + return (bool)config('jarboe.admin_panel.two_factor_auth.enabled'); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | private function getDataForOTP(): array |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | return [ |
| 29 | 29 | 'avatar' => 'mimes:jpeg,bmp,png,gif', |
| 30 | 30 | 'name' => 'required', |
| 31 | - 'email' => 'required|email|unique:admins,email,'. $this->route('id'), |
|
| 31 | + 'email' => 'required|email|unique:admins,email,'.$this->route('id'), |
|
| 32 | 32 | 'password' => 'confirmed', |
| 33 | 33 | ]; |
| 34 | 34 | } |
@@ -9,9 +9,13 @@ |
||
| 9 | 9 | private $styles = []; |
| 10 | 10 | private $scripts = []; |
| 11 | 11 | |
| 12 | - private function __construct() {} |
|
| 12 | + private function __construct() |
|
| 13 | + { |
|
| 14 | +} |
|
| 13 | 15 | |
| 14 | - private function __clone() {} |
|
| 16 | + private function __clone() |
|
| 17 | + { |
|
| 18 | +} |
|
| 15 | 19 | |
| 16 | 20 | private static function getInstance() |
| 17 | 21 | { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | __DIR__.'/../resources/assets' => public_path('vendor/jarboe'), |
| 51 | 51 | ], 'public'); |
| 52 | 52 | |
| 53 | - $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'jarboe'); |
|
| 53 | + $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'jarboe'); |
|
| 54 | 54 | |
| 55 | 55 | $this->registerViewComposer(); |
| 56 | 56 | $this->registerBladeDirectives(); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | private function registerBladeDirectives() |
| 79 | 79 | { |
| 80 | - Blade::directive('pushonce', function ($expression) { |
|
| 81 | - $params = collect(explode(',', $expression))->map(function ($item) { |
|
| 80 | + Blade::directive('pushonce', function($expression) { |
|
| 81 | + $params = collect(explode(',', $expression))->map(function($item) { |
|
| 82 | 82 | return trim($item); |
| 83 | 83 | }); |
| 84 | 84 | $stack = $params->shift(); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | private function registerViewComposer() |
| 102 | 102 | { |
| 103 | - View::composer('jarboe::layouts.main', function ($view) { |
|
| 103 | + View::composer('jarboe::layouts.main', function($view) { |
|
| 104 | 104 | $themes = [ |
| 105 | 105 | 'default' => 'smart-style-0', |
| 106 | 106 | 'dark' => 'smart-style-1', |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $view->menuOnTop = $this->app->config->get('jarboe.admin_panel.menu_on_top'); |
| 116 | 116 | }); |
| 117 | 117 | |
| 118 | - View::composer('jarboe::inc.locale_selector', function ($view) { |
|
| 118 | + View::composer('jarboe::inc.locale_selector', function($view) { |
|
| 119 | 119 | $view->localeHelper = new Locale(); |
| 120 | 120 | }); |
| 121 | 121 | } |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | $this->app->booted(function() { |
| 126 | 126 | $router = $this->app->get('router'); |
| 127 | - $router->group(app('jarboe')->routeGroupOptions(), function () use ($router) { |
|
| 128 | - $router->get('{any}', function () { |
|
| 127 | + $router->group(app('jarboe')->routeGroupOptions(), function() use ($router) { |
|
| 128 | + $router->get('{any}', function() { |
|
| 129 | 129 | return response()->view('jarboe::errors.404')->setStatusCode(404); |
| 130 | 130 | })->where('any', '.*'); |
| 131 | 131 | }); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | use Yaro\Jarboe\Console\Commands\Make\Tool as MakeTool; |
| 10 | 10 | use Yaro\Jarboe\Helpers\Locale; |
| 11 | 11 | |
| 12 | -class ServiceProvider extends IlluminateServiceProvider |
|
| 12 | +class ServiceProvider extends IlluminateServiceProvider |
|
| 13 | 13 | { |
| 14 | 14 | |
| 15 | 15 | /** |
@@ -27,22 +27,22 @@ |
||
| 27 | 27 | |
| 28 | 28 | if (!empty($_POST)) |
| 29 | 29 | { |
| 30 | - foreach ( $_POST as $key => $value ) |
|
| 31 | - { |
|
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | - continue; |
|
| 30 | + foreach ( $_POST as $key => $value ) |
|
| 31 | + { |
|
| 32 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | + continue; |
|
| 34 | 34 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | - else |
|
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 35 | + if ( get_magic_quotes_gpc() ) |
|
| 36 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | + else |
|
| 38 | + $value = htmlspecialchars( (string)$value ); |
|
| 39 | 39 | ?> |
| 40 | 40 | <tr> |
| 41 | 41 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
| 42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
| 43 | 43 | </tr> |
| 44 | 44 | <?php |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | } |
| 47 | 47 | ?> |
| 48 | 48 | </table> |
@@ -27,18 +27,18 @@ |
||
| 27 | 27 | |
| 28 | 28 | if (!empty($_POST)) |
| 29 | 29 | { |
| 30 | - foreach ( $_POST as $key => $value ) |
|
| 30 | + foreach ($_POST as $key => $value) |
|
| 31 | 31 | { |
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 32 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) |
|
| 33 | 33 | continue; |
| 34 | 34 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 35 | + if (get_magic_quotes_gpc()) |
|
| 36 | + $value = htmlspecialchars(stripslashes((string)$value)); |
|
| 37 | 37 | else |
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 38 | + $value = htmlspecialchars((string)$value); |
|
| 39 | 39 | ?> |
| 40 | 40 | <tr> |
| 41 | - <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
|
| 41 | + <th style="vertical-align: top"><?php echo htmlspecialchars((string)$key); ?></th> |
|
| 42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
| 43 | 43 | </tr> |
| 44 | 44 | <?php |
@@ -25,18 +25,18 @@ |
||
| 25 | 25 | </thead> |
| 26 | 26 | <?php |
| 27 | 27 | |
| 28 | -if (!empty($_POST)) |
|
| 29 | -{ |
|
| 30 | - foreach ( $_POST as $key => $value ) |
|
| 31 | - { |
|
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | - continue; |
|
| 28 | +if (!empty($_POST)) { |
|
| 29 | + foreach ( $_POST as $key => $value ) { |
|
| 30 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) { |
|
| 31 | + continue; |
|
| 32 | + } |
|
| 34 | 33 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | - else |
|
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 39 | -?> |
|
| 34 | + if ( get_magic_quotes_gpc() ) { |
|
| 35 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 36 | + } else { |
|
| 37 | + $value = htmlspecialchars( (string)$value ); |
|
| 38 | + } |
|
| 39 | + ?> |
|
| 40 | 40 | <tr> |
| 41 | 41 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
| 42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | use Yaro\Jarboe\Http\Controllers\AuthController; |
| 6 | 6 | use Yaro\Jarboe\Http\Controllers\DashboardController; |
| 7 | 7 | |
| 8 | -Route::group(Jarboe::routeGroupOptions(true), function () { |
|
| 8 | +Route::group(Jarboe::routeGroupOptions(true), function() { |
|
| 9 | 9 | Route::get('/', [AuthController::class, 'root']); |
| 10 | 10 | Route::get('login', [AuthController::class, 'showLogin']); |
| 11 | 11 | Route::post('login', [AuthController::class, 'login']); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | } |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | -Route::group(Jarboe::routeGroupOptions(), function () { |
|
| 19 | +Route::group(Jarboe::routeGroupOptions(), function() { |
|
| 20 | 20 | Route::get('logout', [AuthController::class, 'logout']); |
| 21 | 21 | |
| 22 | 22 | Route::get(config('jarboe.admin_panel.dashboard'), [DashboardController::class, 'dashboard']); |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | use Yaro\Jarboe\Facades\Jarboe; |
| 5 | 5 | use Yaro\Jarboe\Http\Controllers\CommonController; |
| 6 | 6 | |
| 7 | -Route::group(Jarboe::routeGroupOptions(), function () { |
|
| 7 | +Route::group(Jarboe::routeGroupOptions(), function() { |
|
| 8 | 8 | Route::get('reset-panel-settings', [CommonController::class, 'resetPanelSettings'])->name('reset_panel_settings'); |
| 9 | 9 | }); |
@@ -5,10 +5,10 @@ |
||
| 5 | 5 | use Yaro\Jarboe\Http\Controllers\AdminsController; |
| 6 | 6 | use Yaro\Jarboe\Http\Controllers\AdminsRolesController; |
| 7 | 7 | |
| 8 | -Route::group(Jarboe::routeGroupOptions(), function () { |
|
| 8 | +Route::group(Jarboe::routeGroupOptions(), function() { |
|
| 9 | 9 | Route::group([ |
| 10 | 10 | 'prefix' => 'admin-panel', |
| 11 | - ], function () { |
|
| 11 | + ], function() { |
|
| 12 | 12 | Jarboe::crud('admins', AdminsController::class); |
| 13 | 13 | Jarboe::crud('roles-and-permissions', AdminsRolesController::class); |
| 14 | 14 | }); |