thedevdojo / voyager-themes

Theme Hook for Voyager
81 stars 23 forks source link

[BUG] Route [voyager.theme.index] not defined. #20

Open DerekBuntin opened 5 years ago

DerekBuntin commented 5 years ago

Hooks Version: ^1.0 Voyager Version: 1.1.10 Laravel Version: 5.7.24 PHP Version: >=7.1.3 Description: Themes and redirect hooks give the same error:

Route [voyager.theme.index] not defined.

Steps To Reproduce: Try and access admin after logging in and the system gives a 500 error message.

NOTE:

Hooks Version: ^1.0 Voyager Version: 1.1 Laravel Version: 5.7.24 PHP Version: >=7.1.3

I have another project on the same local system running earlier versions of voyager and the two hook packages that work with Laravel 5.7.24.

UPDATE:

I updated the working project from Voyager 1.1 to 1.1.10 and this issue appeared.

DerekBuntin commented 5 years ago

This conditional logic is what's causing the problem in the register method:

if (request()->is(config('voyager.prefix')) || request()->is(config('voyager.prefix').'/*')) { // }

Once commented out the hook worked with exception to an error being generated when running:

php artisan optimize

Saying that it can't optimize the routes because of the closure being used within the addThemesRouter so I commented out the original and replaced it with the following:

$router->get('themes/options', $namespacePrefix.'ThemesController@index');

I commented out the original:

$router->get('themes/options', function () { return redirect(route('voyager.theme.index')); });

Everything was back up and running as normal after these changes were made.

billoo2378 commented 5 years ago

Hello, I am interested in the voyager theme but i actually want to know that the voyager theme will be suitable for my site http://restaurantfastfood.com/ and how many versions of the voyager themes available so far.

predam commented 2 years ago

The problem is related to the route cache. This should fix the problem php artisan route:clear

hugo-abdou commented 2 years ago

@predam thank you