Filament v4 livewire 404Livewire 404 not found already added route into web.php like v3
Hello all. Need urgent help i deployed my project to server . I used filament v4 , facing issue livewire 404 not found . I followed all step which we follow during filament v3. I already added route into web.php where we pass custom folders path to remove this 404 error
28 Replies
@Answer Overflow
- What routes are not found?
- And what did you add to
web.php? You don't need to add anything for Filament to work.
- Do you use shared hosting?Yes i am using sharing hosting. But in wampp appache in www folder i am direct calling this. Localhost/crm/ this is the path of project..
In filament v3 we use livewire update and get route . Still need to same in v4 ??
When i am going to logged in and i click login button it shows error 404 not found then the path is
Localhost/livewre/livewire.js
In filament v3 we use livewire update and get routeI don't know what you mean.
sharing hostingShared hosting is always a pain. Can you set the domain root to
public/ folder with your shared hosting?<?php
use Illuminate\Support\Facades\Route;
// Default home route
Route::get('/', function () {
return view('welcome');
});
// Fix for Filament / Livewire routes when deployed in a subdirectory
Route::get('/livewire/livewire.js', function () {
return redirect('/vendor/livewire/livewire.js');
});
Route::get('/livewire/livewire.js.map', function () {
return redirect('/vendor/livewire/livewire.js.map');
});
// Optional if you use Filament in a custom prefix (like /admin)
Route::prefix('admin')->group(function () {
// Filament automatically registers its own routes
// You don't have to manually add resources here
});
This is the routes we use
Wait i am sharing with you my web.php
C:\wamp64\www\apnaclinic-crm-portal
this is my path where is my project is located
this is my web.php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
use App\Http\Controllers\InvoiceController;
use Livewire\Livewire;
Livewire::setScriptRoute(function ($handle) {
return Route::get('apnaclinic-crm-portal/public/livewire/livewire.js', $handle);
});
Livewire::setUpdateRoute(function ($handle) {
return Route::post('apnaclinic-crm-portal/public/livewire/update', $handle);
});

Request URL
http://localhost/livewire/update
Request Method
POST
Status Code
404 Not Found
Remote Address
[::1]:80
Referrer Policy
strict-origin-when-cross-origin
did u understand ?
please solve my issue
@Dennis Koch
@toeknee
@Dan Harrin @Dennis Koch
Do not tag people! #✅┊rules
sorry i am new here
need help
Yeah, everybody in here needs help. You are not alone.
And everybody is helping in his free time.
ok , so please let me know what mistake i am doing in code , in filament v 3 i resolved this issue by adding the routes
Regarding your question:
Your setup looks super hacky. Laravel doesn't work well with subdirectory setups. If your hosting provider doesn't support setting the document root of the app to
public/ you will have a hard time.so is there any solution?? in v3 we resolve it by doing above mentioned solution
I don't know. Maybe. I never had to do any hacks to make Laravel/Livewire/Filament work because I don't use Shared Hosting. So I can't really help
youre trying to patch a livewire issue, not a filament issue
and since filament v3 and filament v4 both use livewire 3, i think youre doing something wrong
Btw. since your don't have a document root and use
apnaclinic-crm-portal/public your might be vulnerable to exploits of the .env (apnaclinic-crm-portal/.env) file and storage files.shared hosting is such a bad choice for laravel. its not even really cheaper than a vps nowadays
It's usually never about the price, but the maintenance.
I dont think thats an excuse nowadays, Laravel apps can run fine with minimal maintainence
It's not about the app. It's about the server that you have to maintain. Even if it's usually not much using Ploi/Forge it still is *your responsibility. Shared hosting is not.
Eh, I think that is not a real thing most people consider
What? The maintenance question ? 😅 That's usually the first question in a company: Who is responsible for this.
If a project is small enough to use shared hosting, this should not be a concern
When it is a problem, its on larger apps and shared hosting is ruled out anyway
I’m not sure — I’ve shared the entire process that I followed in Filament v3, but those steps aren’t working in Filament v4. If you have a proper deployment method, please let me know.
GitHub
Getting "The POST method is not supported for route admin/login. Su...
Package Panel builder Package Version v3.0.0 How can we help you? I've recently deployed my Filament application to a server, but I'm encountering an error message stating 'The POST met...
Yes i published
It is not about hosting i also have VPS but for testing i am doing it.. it is about how anyone can use technology and how many ways of deployment
Shared hosting tends to be the problem because the primary public directory is above the public directory in laravel. So the mod_security setup and any proxy's make it complicated as you need to have a solid understanding of the mod_rewrite or nginx setup.
The point is usually you would use a single domain not a sub domain or sub directory.
For example, does it work perfect find using Laravel Herd whereby it proxy's and renders under a single domain correctly.
Try changing your shared hosting primary directory to the laravel public folder and all your issues will be resolved... IF shared hosting allows, but as all shared hosting can be configured differently, you should ask your host how best to approach it.
It is also worth pointing out that deploying in a shared hosting enviroment is generally very slow opposed to a forge/ploi CI/CD approach
Hey Hassan, what laravel version do you use? i have same problem using Filament4, Laravel 12..
Try using Laravel 11..
Here some discussion about it
https://github.com/livewire/livewire/discussions/9480
GitHub
Laravel ^12.29 release breaks overriding of livewire/update script ...
Livewire version v3.6.4 Laravel version v12.29 Which PHP version are you using? PHP 8.3 What is the problem? Currently, Laravel always takes the first registration of a route. Because of that, over...