spatie/laravel-demo-mode

Laravel's 404 page bypasses demo-mode

Closed this issue · 3 comments

When in demo mode and visiting a route that doesn't exist, the 404 is displayed.
This demo-mode page should be displayed instead.

We'll handle this further in #20

hello guys,

I do not want to rush around, but .. The fallback added in #20 works even if demo-mode.enabled is false; which I guess should not be wanted behaviour ..

So, if the demoMode is disabled, 404 response results in redirect to demo-mode.redirect_unauthorized_users_to_url

It can be solved by adding a condition to DemoModeServiceProvider.php like:

if (config('demo-mode.enabled')) {
    $router->fallback('\Spatie\DemoMode\DemoModeController@catchFallback');
}

or rewrite logic of DemoModeController::catchFallback() as it does not take in account disabled demoMode.

Thank you for all what you do.

@jankremlacek Thanks for reporting this, we'll take care of this soon.