whitecube / nova-page

Static pages content management for Laravel Nova
https://whitecube.github.io/nova-page
MIT License
238 stars 41 forks source link

Conflict with cached routes #25

Open alex-osborn opened 5 years ago

alex-osborn commented 5 years ago

The Nova Pages tool doesn't load correctly when routes are cached with php artisan route:cache.

Steps to reproduce:

  1. Load Nova, navigate to Pages tool. The tool load correctly.
  2. Run php artisan route:cache.
  3. Reload the tool. The tool does not load correctly.
  4. Clear cached routes with php artisan route:clear.
  5. Reload the tool. The tool loads correctly again.

From my debugging, appears as if the original Nova routes are used when caching is enabled which is giving a dependency injection error.

Screen Shot 2019-03-13 at 12 11 07 PM

raphcollective commented 5 years ago

Hey, I tried to do some exploration on the issue.

I discovered than when the routes are cached they don't seem to show up in the Route::getRoutes()->getRoutes() array in the registerRouteTemplates function of the TemplatesRepository. Actually only the nova routes show up in there. They do appear correctly in route:list and in tinker when I call the function manually. I couldn't really figure out why but I hope this helps.

I'm using a fresh Laravel 5.8 project with Nova 2, this is how the route is registered: Route::get('/home', 'PageController@index')->template(\App\Nova\Templates\Test::class)->name('home');

slavarazum commented 5 years ago

Catch the same issue, have any ideas how to fix it? Don't want to lose ability of route caching 😕

Arkenis commented 5 years ago

+1

still having those issues with Laravel Nova 2.0.11 + nova-page 0.2.3

shalawani commented 4 years ago

Any idea to solve this issue guys, please

chrispage1 commented 4 years ago

Just hit this issue myself when deploying this with a project using deployer. It breaks a lot of stuff!

I've even tried limiting down my routes file so it doesn't leverage the middleware, and doesn't define a template but still no joy...

thinkspill commented 4 years ago

Hit this issue on a new (nova 2.7) project just now.

gwleuverink commented 4 years ago

@voidgraphics The issue still exists with L6.14.0 and Nova 2.10.1

nickbluestone98 commented 2 years ago

Is there any fix for this yet @voidgraphics ? Really seems a shame to not get this bug fixed. Have the exact same issues as above in Laravel 8 and Nova 3. The package itself is fantastic and super useful.