@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | $this->loadViewsFrom(__DIR__.'/types', 'types'); |
25 | 25 | |
26 | 26 | // Publish the files |
27 | - $this->publishes([__DIR__.'/configs/crudbooster.php' => config_path('crudbooster.php')],'cb_config'); |
|
27 | + $this->publishes([__DIR__.'/configs/crudbooster.php' => config_path('crudbooster.php')], 'cb_config'); |
|
28 | 28 | $this->publishes([__DIR__.'/localization' => resource_path('lang')], 'cb_localization'); |
29 | - $this->publishes([__DIR__.'/database' => base_path('database')],'cb_migration'); |
|
30 | - $this->publishes([__DIR__.'/templates/CBHook.stub'=> app_path('Http/CBHook.php')],'cb_hook'); |
|
31 | - $this->publishes([__DIR__ . '/assets' =>public_path('cb_asset')],'cb_asset'); |
|
29 | + $this->publishes([__DIR__.'/database' => base_path('database')], 'cb_migration'); |
|
30 | + $this->publishes([__DIR__.'/templates/CBHook.stub'=> app_path('Http/CBHook.php')], 'cb_hook'); |
|
31 | + $this->publishes([__DIR__.'/assets' =>public_path('cb_asset')], 'cb_asset'); |
|
32 | 32 | |
33 | 33 | require __DIR__.'/validations/validation.php'; |
34 | 34 | require __DIR__.'/routes.php'; |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | require __DIR__.'/helpers/Helper.php'; |
47 | 47 | |
48 | 48 | // Singletons |
49 | - $this->app->singleton('crudbooster', function () |
|
49 | + $this->app->singleton('crudbooster', function() |
|
50 | 50 | { |
51 | 51 | return true; |
52 | 52 | }); |
53 | 53 | $this->app->singleton('ColumnSingleton', ColumnSingleton::class); |
54 | 54 | |
55 | 55 | // Merging configuration |
56 | - $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php','crudbooster'); |
|
56 | + $this->mergeConfigFrom(__DIR__.'/configs/crudbooster.php', 'crudbooster'); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | // Register Commands |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | private function registerTypeRoutes() { |
75 | 75 | $routes = rglob(__DIR__.DIRECTORY_SEPARATOR."types".DIRECTORY_SEPARATOR."Route.php"); |
76 | - foreach($routes as $route) { |
|
76 | + foreach ($routes as $route) { |
|
77 | 77 | require $route; |
78 | 78 | } |
79 | 79 | } |
@@ -1,40 +1,40 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Developer Backend Middleware |
4 | -Route::group(['middleware' => ['web',\crocodicstudio\crudbooster\middlewares\CBDeveloper::class], |
|
4 | +Route::group(['middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBDeveloper::class], |
|
5 | 5 | 'prefix'=>cbConfig('DEV_PATH'), |
6 | - 'namespace' => 'crocodicstudio\crudbooster\controllers'], function () { |
|
7 | - cb()->routeController("modules", "DeveloperModulesController",'crocodicstudio\crudbooster\controllers'); |
|
8 | - cb()->routeController("menus", "DeveloperMenusController",'crocodicstudio\crudbooster\controllers'); |
|
9 | - cb()->routeController("roles","DeveloperRolesController",'crocodicstudio\crudbooster\controllers'); |
|
10 | - cb()->routeController("users","DeveloperUsersController",'crocodicstudio\crudbooster\controllers'); |
|
11 | - cb()->routeGet("/","DeveloperDashboardController@getIndex"); |
|
6 | + 'namespace' => 'crocodicstudio\crudbooster\controllers'], function() { |
|
7 | + cb()->routeController("modules", "DeveloperModulesController", 'crocodicstudio\crudbooster\controllers'); |
|
8 | + cb()->routeController("menus", "DeveloperMenusController", 'crocodicstudio\crudbooster\controllers'); |
|
9 | + cb()->routeController("roles", "DeveloperRolesController", 'crocodicstudio\crudbooster\controllers'); |
|
10 | + cb()->routeController("users", "DeveloperUsersController", 'crocodicstudio\crudbooster\controllers'); |
|
11 | + cb()->routeGet("/", "DeveloperDashboardController@getIndex"); |
|
12 | 12 | }); |
13 | 13 | |
14 | 14 | // Developer Auth Middleware |
15 | 15 | Route::group(['middleware' => ['web'], |
16 | 16 | 'prefix'=>cbConfig('DEV_PATH'), |
17 | - 'namespace' => 'crocodicstudio\crudbooster\controllers'], function () { |
|
18 | - cb()->routePost("login","AdminAuthController@postLoginDeveloper"); |
|
19 | - cb()->routeGet("login","AdminAuthController@getLoginDeveloper"); |
|
20 | - cb()->routeGet("logout","AdminAuthController@getLogoutDeveloper"); |
|
17 | + 'namespace' => 'crocodicstudio\crudbooster\controllers'], function() { |
|
18 | + cb()->routePost("login", "AdminAuthController@postLoginDeveloper"); |
|
19 | + cb()->routeGet("login", "AdminAuthController@getLoginDeveloper"); |
|
20 | + cb()->routeGet("logout", "AdminAuthController@getLogoutDeveloper"); |
|
21 | 21 | }); |
22 | 22 | |
23 | 23 | // Routing without any middleware |
24 | -Route::group(['middleware' => ['web'], 'namespace' => '\crocodicstudio\crudbooster\controllers'], function () { |
|
24 | +Route::group(['middleware' => ['web'], 'namespace' => '\crocodicstudio\crudbooster\controllers'], function() { |
|
25 | 25 | cb()->routeGet('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', "FileController@getPreview"); |
26 | 26 | }); |
27 | 27 | |
28 | 28 | // Routing without any middleware with admin prefix |
29 | -Route::group(['middleware' => ['web'], 'prefix' => cbConfig('ADMIN_PATH'), 'namespace' => 'crocodicstudio\crudbooster\controllers'], function () { |
|
29 | +Route::group(['middleware' => ['web'], 'prefix' => cbConfig('ADMIN_PATH'), 'namespace' => 'crocodicstudio\crudbooster\controllers'], function() { |
|
30 | 30 | cb()->routeGet('logout', "AdminAuthController@getLogout"); |
31 | 31 | cb()->routePost('login', "AdminAuthController@postLogin"); |
32 | 32 | cb()->routeGet('login', "AdminAuthController@getLogin"); |
33 | 33 | }); |
34 | 34 | |
35 | 35 | // Routing package controllers |
36 | -cb()->routeGroupBackend(function () { |
|
37 | - cb()->routeController('profile', 'AdminProfileController','crocodicstudio\crudbooster\controllers'); |
|
36 | +cb()->routeGroupBackend(function() { |
|
37 | + cb()->routeController('profile', 'AdminProfileController', 'crocodicstudio\crudbooster\controllers'); |
|
38 | 38 | }); |
39 | 39 | |
40 | 40 | // Auto Routing for App\Http\Controllers |
@@ -42,24 +42,24 @@ discard block |
||
42 | 42 | 'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBBackend::class], |
43 | 43 | 'prefix' => cbConfig('ADMIN_PATH'), |
44 | 44 | 'namespace' => 'App\Http\Controllers', |
45 | -], function () { |
|
45 | +], function() { |
|
46 | 46 | |
47 | 47 | if (Request::is(cbConfig('ADMIN_PATH'))) { |
48 | - if($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) { |
|
48 | + if ($dashboard = cbConfig("ADMIN_DASHBOARD_CONTROLLER")) { |
|
49 | 49 | cb()->routeGet("/", $dashboard); |
50 | - }else{ |
|
50 | + } else { |
|
51 | 51 | cb()->routeGet("/", "\crocodicstudio\crudbooster\controllers\AdminDashboardController@getIndex"); |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | 55 | $controllers = glob(app_path('Http/Controllers/Admin*Controller.php')); |
56 | 56 | |
57 | - foreach($controllers as $controller) { |
|
57 | + foreach ($controllers as $controller) { |
|
58 | 58 | $controllerName = basename($controller); |
59 | - $controllerName = rtrim($controllerName,".php"); |
|
59 | + $controllerName = rtrim($controllerName, ".php"); |
|
60 | 60 | $className = '\App\Http\Controllers\\'.$controllerName; |
61 | 61 | $controllerClass = new $className(); |
62 | - if(method_exists($controllerClass, 'cbInit')) { |
|
62 | + if (method_exists($controllerClass, 'cbInit')) { |
|
63 | 63 | cb()->routeController($controllerClass->getData('permalink'), $controllerName); |
64 | 64 | } |
65 | 65 | } |
@@ -14,21 +14,21 @@ |
||
14 | 14 | { |
15 | 15 | public function postUploadFile() |
16 | 16 | { |
17 | - if(auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
17 | + if (auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
18 | 18 | |
19 | 19 | $file = null; |
20 | 20 | try { |
21 | 21 | |
22 | 22 | cb()->validation([ |
23 | - 'userfile' => 'required|mimes:' . implode(",",config('crudbooster.UPLOAD_FILE_EXTENSION_ALLOWED')) |
|
23 | + 'userfile' => 'required|mimes:'.implode(",", config('crudbooster.UPLOAD_FILE_EXTENSION_ALLOWED')) |
|
24 | 24 | ]); |
25 | 25 | |
26 | 26 | $file = cb()->uploadFile('userfile', true); |
27 | 27 | |
28 | 28 | } catch (CBValidationException $e) { |
29 | - return response()->json(['status'=>false,'message'=>$e->getMessage()]); |
|
29 | + return response()->json(['status'=>false, 'message'=>$e->getMessage()]); |
|
30 | 30 | } catch (\Exception $e) { |
31 | - return response()->json(['status'=>false,'message'=>$e->getMessage()]); |
|
31 | + return response()->json(['status'=>false, 'message'=>$e->getMessage()]); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | return response()->json([ |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -cb()->routeGroupBackend(function () { |
|
4 | - cb()->routePost("upload-file",'\crocodicstudio\crudbooster\types\file\FileController@postUploadFile'); |
|
3 | +cb()->routeGroupBackend(function() { |
|
4 | + cb()->routePost("upload-file", '\crocodicstudio\crudbooster\types\file\FileController@postUploadFile'); |
|
5 | 5 | }); |
6 | 6 | \ No newline at end of file |
@@ -2,7 +2,7 @@ |
||
2 | 2 | <?php /** @var \crocodicstudio\crudbooster\types\radio\RadioModel $column */ ?> |
3 | 3 | @foreach($column->getOptions() as $key=>$value) |
4 | 4 | <?php |
5 | - $columnValue = old($column->getName())?:($column->getDefaultValue())?:$column->getValue(); |
|
5 | + $columnValue = old($column->getName()) ?: ($column->getDefaultValue()) ?: $column->getValue(); |
|
6 | 6 | ?> |
7 | 7 | <div class="{{ $column->getDisabled()?"disabled":"" }}"> |
8 | 8 | <label class='radio-inline'> |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function indexRender($row, $column) |
23 | 23 | { |
24 | 24 | $value = trim(strip_tags($row->{ $column->getField() })); |
25 | - if($column->getLimit()) { |
|
25 | + if ($column->getLimit()) { |
|
26 | 26 | $value = Str::limit($value, $column->getLimit()); |
27 | 27 | } |
28 | 28 | return $value; |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function assignment($value, $column) |
22 | 22 | { |
23 | - return @implode(";", request( $column->getName() )); |
|
23 | + return @implode(";", request($column->getName())); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -cb()->routeGroupBackend(function () { |
|
4 | - cb()->routePost("upload-image",'\crocodicstudio\crudbooster\types\image\ImageController@postUploadImage'); |
|
3 | +cb()->routeGroupBackend(function() { |
|
4 | + cb()->routePost("upload-image", '\crocodicstudio\crudbooster\types\image\ImageController@postUploadImage'); |
|
5 | 5 | }); |
6 | 6 | \ No newline at end of file |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function indexRender($row, $column) |
23 | 23 | { |
24 | 24 | $value = trim(strip_tags($row->{ $column->getField() })); |
25 | - if($column->getLimit()) { |
|
25 | + if ($column->getLimit()) { |
|
26 | 26 | $value = Str::limit($value, $column->getLimit()); |
27 | 27 | } |
28 | 28 | return $value; |