diff --git a/src/CRUDBoosterServiceProvider.php b/src/CRUDBoosterServiceProvider.php index d95cbc5fc..4338682ee 100644 --- a/src/CRUDBoosterServiceProvider.php +++ b/src/CRUDBoosterServiceProvider.php @@ -24,11 +24,11 @@ class CRUDBoosterServiceProvider extends ServiceProvider public function boot() { - $this->loadViewsFrom(__DIR__.'/views', 'crudbooster'); $this->publishes([__DIR__.'/configs/crudbooster.php' => config_path('crudbooster.php')], 'cb_config'); $this->publishes([__DIR__.'/localization' => resource_path('lang')], 'cb_localization'); - $this->publishes([__DIR__.'/database' => base_path('database')], 'cb_migration'); + $this->publishes([__DIR__.'/database/migrations' => base_path('database/migrations/crudbooster')], 'cb_migration'); + $this->publishes([__DIR__.'/database/seeds' => base_path('database/seeds')], 'cb_migration'); /* Integrate LFM to CRUDBooster */ $this->publishes([ diff --git a/src/Modules/MenuModule/menus_routes.php b/src/Modules/MenuModule/menus_routes.php index af9cc2852..2bbef8f87 100644 --- a/src/Modules/MenuModule/menus_routes.php +++ b/src/Modules/MenuModule/menus_routes.php @@ -47,15 +47,15 @@ Route::group(['middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => ctrlNamespace(), ], function () use ($dashboard_menu) { - $dashboard_type = $dashboard_menu->type; - $path = $dashboard_menu->path; - if (! $dashboard_menu) { return; } + $dashboard_type = $dashboard_menu->type; + $path = $dashboard_menu->path; + if ($dashboard_type == 'Statistic') { - Route::get('/', '\\crocodicstudio\\crudbooster\\StatisticModule\\AdminStatisticBuilderController@getDashboard'); + Route::get('/', '\\crocodicstudio\\crudbooster\\Modules\\StatisticModule\\AdminStatisticBuilderController@getDashboard'); } elseif ($dashboard_type == 'Module') { $module = CRUDBooster::first('cms_moduls', ['path' => $path]); Route::get('/', $module->controller.'@getIndex'); @@ -70,8 +70,8 @@ } }); -Route::group(['middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => $namespace, -], function () use ($namespace, $dashboard_menu) { +Route::group(['middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => '\crocodicstudio\crudbooster\controllers', +], function () use ($dashboard_menu) { if (! $dashboard_menu) { CRUDBooster::routeController('/', '\crocodicstudio\crudbooster\Modules\AuthModule\AuthController'); } diff --git a/src/commands/CrudboosterInstallationCommand.php b/src/commands/CrudboosterInstallationCommand.php index d5cbc114d..8c0a2c19a 100644 --- a/src/commands/CrudboosterInstallationCommand.php +++ b/src/commands/CrudboosterInstallationCommand.php @@ -249,7 +249,7 @@ private function installCrudbooster() $process->setWorkingDirectory(base_path())->run(); $this->info('Migrating database...'); - $this->call('migrate'); + $this->call('migrate', ['--path'=> '\database\migrations\crudbooster']); if (! class_exists('CBSeeder')) { require_once __DIR__.'/../database/seeds/CBSeeder.php'; diff --git a/src/controllers/Forms/UsersForm.php b/src/controllers/Forms/UsersForm.php deleted file mode 100644 index f30dfc442..000000000 --- a/src/controllers/Forms/UsersForm.php +++ /dev/null @@ -1,37 +0,0 @@ - "Name", "name" => "name", 'required' => true, 'validation' => 'required|alpha_spaces|min:3']; - $form[] = [ - "label" => "Email", - "name" => "email", - 'required' => true, - 'type' => 'email', - 'validation' => 'required|email|unique:cms_users,email,'.\CRUDBooster::getCurrentId(), - ]; - $form[] = [ - "label" => "Photo", - "name" => "photo", - "type" => "upload", - "help" => "Recommended resolution is 200x200px", - 'required' => true, - 'validation' => 'required|image|max:1000', - ]; - $form[] = [ - "label" => "Privilege", - "name" => "id_cms_privileges", - "type" => "select_datatable", - "options" => ["table" => "cms_privileges", "field_value" => "id", "field_label" => "name"], - 'required' => true, - ]; - $form[] = ["label" => "Password", "name" => "password", "type" => "password", "help" => "Please leave empty if not change"]; - - return $form; - } -} \ No newline at end of file diff --git a/src/routes.php b/src/routes.php index 551e81431..670970903 100644 --- a/src/routes.php +++ b/src/routes.php @@ -1,5 +1,9 @@ ['web'], 'namespace' => $namespace], function () { Route::get('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', ['uses' => 'FileController@getPreview', 'as' => 'fileControllerPreview']); @@ -10,14 +14,15 @@ // ROUTER FOR OWN CONTROLLER FROM CB Route::group([ - 'middleware' => ['web', '\crocodicstudio\crudbooster\middlewares\CBBackend'], + 'middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => ctrlNamespace(), ], function () { + CRUDBooster::routeController('users', 'AdminUsersController'); try { - $moduls = DB::table('cms_moduls')->where('path', '!=', '')->where('controller', '!=', '')->where('is_protected', 0)->get(); - foreach ($moduls as $v) { - CRUDBooster::routeController($v->path, $v->controller); + $modules = DB::table('cms_moduls')->where('path', '!=', '')->where('controller', '!=', '')->where('is_protected', 0)->get(); + foreach ($modules as $module) { + CRUDBooster::routeController($module->path, $module->controller); } } catch (Exception $e) { } @@ -25,14 +30,14 @@ /* ROUTER FOR BACKEND CRUDBOOSTER */ Route::group([ - 'middleware' => ['web', \crocodicstudio\crudbooster\middlewares\CBBackend::class], + 'middleware' => ['web', CBBackend::class], 'prefix' => cbAdminPath(), 'namespace' => $namespace, ], function () use ($namespace){ /* DO NOT EDIT THESE BELLOW LINES */ CRUDBooster::routeController('notifications', 'AdminNotificationsController', $namespace); - CRUDBooster::routeController('users', 'AdminUsersController'); + }); Route::group([