Skip to content

Commit fe6f8aa

Browse files
committed
Adding an option that allows for the pre-baked routes to not be loaded
1 parent acda0b0 commit fe6f8aa

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Config/quickadmin.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
//Default home action
2424
// 'homeAction' => '\App\Http\Controllers\MyOwnController@index',
2525
// Default role to access users and CRUD
26-
'defaultRole' => 1
26+
'defaultRole' => 1,
2727

28-
];
28+
// If set to true, you'll need to copy the routes
29+
// from vendor/laraveldaily/quickadmin/src/routes.php into your own /routes folder
30+
'standaloneRoutes' => false
31+
32+
];

src/routes.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
use Illuminate\Support\Facades\View;
88
use Laraveldaily\Quickadmin\Models\Menu;
99

10+
if (config('quickadmin.standaloneRoutes')) {
11+
return;
12+
}
13+
1014
if (Schema::hasTable('menus')) {
1115
$menus = Menu::with('children')->where('menu_type', '!=', 0)->orderBy('position')->get();
1216
View::share('menus', $menus);
@@ -105,7 +109,6 @@
105109
});
106110
});
107111

108-
// @todo move to default routes.php
109112
Route::group([
110113
'namespace' => 'App\Http\Controllers',
111114
'middleware' => ['web']

0 commit comments

Comments
 (0)