Login not working - admin/livewire/update 405 (Method Not Allowed)
Laravel 11 with Filament v3.
I have a single admin panel, with an empty path, because this app will be running on the
/admin
folder of the root domain.
I've set these Livewire methods to set the correct paths (the issue is also happening without this)
I go to the login screen on admin/login
and enter the login credentials it will thrown an error (screenshot attached).
On the console it will show (other screenshot):
I have the correct path configured on the laravel app (APP_URL=https://example.com/admin
Admin panel configuration (relevant section):
Can someone please point in the right direction?
I've tried many things, but nothing worked.9 Replies
I hate be questionable, but it this a valid help topic? I don’t personally care what the content of your app is. But definitely not clicking on any of these links.
@awcodes really sorry, but I was a very poor choice of a fake domain :D. I've changed it to example.com
Error on the console
No worries. Lol. Just want to make sure.
My best guess is that you are trying to run laravel itself in a sub directory which it’s not setup to do by default so you’ll need to modify your nginx / Apache config to serve it appropriately.
Can’t find it right now, but Chris fidao had a good YouTube video on it.
I encountered the same issue, but I resolved it using the following steps:
1. Copy the
dist
folder located at \vendor\livewire\livewire\dist
.
2. Paste it into the public
directory.
3. Rename the pasted folder to livewire
.@awcodes thanks for the help.
I think the youtube video that you are referring too is this one: https://www.youtube.com/watch?v=tZGg2kdOjhQ&t=12s
My server uses .htaccess, but you are probably right about the issue being related with that.
I'm going to try to tweak the .htaccess settings
@Abdelmjid are you sure that you had the same issue? I've tried your solution but it didn't work.
My problem is not related with missing scripts, it's a backend thing, a method not allowed exception, for a route that exists
I haven't worked with Apache for more than 10 years
For debuggin, I would start with the access log (Apache) + I would take the public/index.php and do a file_put_contents of $_REQUEST and $_SERVER (plain php global variables)
Here, you can see the "step" from the webserver to PHP
Analyze after a request, and you can go from there.
In terms of how Laravel responds, I guess the route will have to have that prefix, or you can opt in to use rewrites
Solution
Solution was to make a proxy route:
This is creating a route with a duplicated
admin
prefix. https://example.com/admin/admin/livewire/update