Skip to content

Commit

Permalink
Merge pull request crocodic-studio#957 from imanghafoori1/master
Browse files Browse the repository at this point in the history
debug + small tweaks
  • Loading branch information
fherryfherry authored Nov 12, 2017
2 parents 4099fbb + 91cfc8a commit f056a63
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 52 deletions.
4 changes: 2 additions & 2 deletions src/CRUDBoosterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
12 changes: 6 additions & 6 deletions src/Modules/MenuModule/menus_routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/CrudboosterInstallationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
37 changes: 0 additions & 37 deletions src/controllers/Forms/UsersForm.php

This file was deleted.

17 changes: 11 additions & 6 deletions src/routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php


use crocodicstudio\crudbooster\middlewares\CBBackend;

$namespace = '\crocodicstudio\crudbooster\controllers';
/* ROUTER FOR UPLOADS */
Route::group(['middleware' => ['web'], 'namespace' => $namespace], function () {
Route::get('uploads/{one?}/{two?}/{three?}/{four?}/{five?}', ['uses' => 'FileController@getPreview', 'as' => 'fileControllerPreview']);
Expand All @@ -10,29 +14,30 @@

// 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) {
}
});

/* 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([
Expand Down

0 comments on commit f056a63

Please sign in to comment.