vanilophp / framework

The truly Laravel E-commerce Framework
https://vanilo.io
MIT License
818 stars 102 forks source link

Cannot change admin prefix #8

Closed tpodg closed 6 years ago

tpodg commented 6 years ago

When adding Framework / AppShell configuration for routes -> prefix in concord.php, an exception is raised: DaveJamesMiller\Breadcrumbs\Exceptions\DuplicateBreadcrumbException : Breadcrumb name "home" has already been registered

fulopattila122 commented 6 years ago

Thanks for the report. I'll look into it either today or on Wednesday.

fulopattila122 commented 6 years ago

Vanilo doc wasn't specific enough, I've updated it.

In the config file (concord.php) you need to include defaults as well. This is due to the way Laravel package configuration works. Quote from https://laravel.com/docs/5.6/packages#configuration:

This method only merges the first level of the configuration array. If your users partially define a multi-dimensional configuration array, the missing options will not be merged.

So your route definitions in concord.php should look something like this:

return [
    'modules' => [
        Konekt\AppShell\Providers\ModuleServiceProvider::class => [
            'ui' => [
                'name' => 'My App Admin',
                'url' => '/myadmin/product' //or whatever your admin start url should be
            ],
            'routes' => [
                'prefix'     => 'myadmin', 
        'middleware' => ['web', 'auth', 'acl'],
        'files'      => ['web'],
        'as' => 'appshell.'
        ],
        ],
        Vanilo\Framework\Providers\ModuleServiceProvider::class => [
        'routes' => [
        'prefix'     => 'myadmin', 
        'middleware' => ['web', 'auth', 'acl'],
        'files'      => ['admin'],
        'as' => 'vanilo.'
        ],
        ]
    ]
];
tpodg commented 6 years ago

Thank you for the clarification. I've tried some variations, but did not include the 'files' option.