Open GurgenYeranosyan opened 1 year ago
Hello. First thing I want to do is ask you (or anyone) to reconsider, because anything you're trying to achieve probably could be done with Roles and Permissions.
That being said, here's some tricky solution I came out with to your request:
app/AdminNew
.app/Admin/Controllers/HomeController.php
to app/AdminNew/Controllers/HomeController.php
and made changes in index
method so you can see them after.routes.php
and bootstrap.php
and edit as you need (mainly you need to change path for '/' route to AdminNew/Controllers/HomeController@index
). config/admin.php
to config/admin_new.php
.'route' => [
'prefix' => 'admin_new',
'namespace' => 'App\\AdminNew\\Controllers',
'middleware' => ['web', 'admin'],
],
'directory' => app_path('AdminNew'),
'bootstrap' => app_path('AdminNew/bootstrap.php'),
'extension_dir' => app_path('AdminNew/Extensions'),
admin_
tables and change config 'database' in your new config file.App\Providers\AppServiceProvider
's register
method add this:
if (0 === strpos(request()->path(), 'admin_new')) {
config(['admin' => config('admin_new')]);
}
At this point you'll probably have many new Errors to fix, so good luck!
how to make a new path like /admin for example /new_admin with config file like new_admin.php, folder like app/new_admin