Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Brand3000's avatar

Nova and global middlewares

Hello! I have a question. I've noticed that when Laravel Nova is working, all the middlewares from the Kernel.php file are being processed. Is there a way to avoid this functioning? Actually, I'd like it to go around my middlewares that are used behind Laravel Nova. Even more. I'd like to avoid processing all the web.php routes for the Laravel Nova url which is saved in the config/nova.php file in the path variable. Is it possible?

0 likes
11 replies
Brand3000's avatar

@jaseofspades88 Ok, I have a resource and its model where I redefine the main table with the $table variable. And it can't be established in a middleware for some reason. To put it another way, when I'm loading the resource with a custom DB table, I'm getting the error about missing the table of the resource which is calculated automatically (it's not being taken from the $table variable).

jaseofspades88's avatar

@Brand3000 I read that three times and I still don't understand. What problem are you trying to solve? Forget middleware, what are you trying to achieve in Laravel Nova? Explain it simply.

Brand3000's avatar

@jaseofspades88 I'm loading a resource /resources/page-translate-resources/24 The model for this resource has the variable protected $table = 'pages_translates'; and I'm getting the error: Table 'winoptionsignals.page-translate-resources' doesn't exist. It happens in the middleware in the line: return $next($request);

Brand3000's avatar

@jaseofspades88 Yep, the problem seems to be in the model. There's a new observation:

If I use the $table variable in the model like so: protected $table = 'pages_translates'; the error is shown: "Base table or view not found: 1146 Table 'win.page-translate-resources' doesn't exist" (page-translate-resources, not pages_translates)

If I don't use the $table variable the error is: "Base table or view not found: 1146 Table 'win.page_translates' doesn't exist" (page_translates not pages_translates)

I'm on the fence and don't understand why the $table variable doesn't influence properly =(

Brand3000's avatar

@jaseofspades88 Yep, it was an issue in absolutely different functionality. As the problem logged in the middleware, I was stuck. Eventually, everything is ok, thank you very much for your attention!

Please or to participate in this conversation.