Closed JackJohansson closed 2 years ago
Please provide full reproducing code for the issue.
So I had to replace all the files in my app to find out which file was causing the issue. It appears that it was this line:
$route = \Illuminate\Support\Facades\Route::getRoutes()->match( request() )?->getName();
This line is inside a middleware that it assigned to the $middleware
property inside Kernel.php
. If I move this to the web
middleware group, the issue is solved, but parts of the app break.
It's worth mentioning that I've bound the class that holds the line as a singleton to the service container, and I'm type-hinting its name inside the middleware's constructor. Then, I call a method that holds the above line.
Any ideas why this is causing an issue with nova?
As mentioned earlier, will need reproducing code to debug this.
Just put that line in the handle method of "ANY" middleware registered in the middelware
property of Kernel.php
.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The issue is related to Laravel itself, but it drastically impacts Nova's ability to to save models.
Since this thread is getting ignored, for anyone else who encounters this issue later, they can move the Route::getRoutes()->match( ... )
line to the "web" middleware group.
Description:
I'm working on an app with 2 different user types / guards. Recently I've noticed that I no longer can save, update or create any resource via nova. Every attempt results in the following error:
There was a problem submitting the form : "Method Not Allowed"
I ran
php artisan route:list
, and I noticed that the method actually is registered:I commented my entire route files to see if it helps, but it didn't. I'm also able to log out and into nova dashboard, so the guard should be working fine.
The app is being developed on local, but the same applies to the production version.
Here are some of the configs that might help:
app.php
'url' => env( 'APP_URL', 'http://app.test')
auth.php
cors.php
nova.php
sanctum.php
I also tried commenting out all of my custom exception handlers, and auth service providers to see if there's something wrong there, but no progress.