404 errror and Post request to livewire/update

Hi , I have an issue when i try to login to my admin panel. I get a 404 error and when i check on my network tab a post request is sent to /livewire/update which give 404 error. how can i solve this issue. I am using vps server but on my local it work perfect.
No description
No description
13 Replies
bhlsunshine
bhlsunshine8mo ago
Fix the /livewire/livewire.js 404 not found error
Learn how to fix the 404 not found error occurring for /livewire/livewire.js.
Umar Farooq
Umar Farooq8mo ago
how did you solve @pythonista ?
Dennis Koch
Dennis Koch8mo ago
Sounds like some server misconfiguration
Umar Farooq
Umar Farooq8mo ago
I'm running apllication on my local env
Umar Farooq
Umar Farooq8mo ago
No description
Umar Farooq
Umar Farooq8mo ago
I did update Login Action
public function authenticate(): ?LoginResponse
{
$data = $this->form->getState();

if (! Auth::attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
$this->throwFailureValidationException();
}

$user = Filament::auth()->user();

if (
($user instanceof FilamentUser) &&
(! $user->canAccessPanel(Filament::getCurrentPanel()))
) {
Filament::auth()->logout();

$this->throwFailureValidationException();
}

session()->regenerate();

dd('ee');

return app(LoginResponse::class);
}
public function authenticate(): ?LoginResponse
{
$data = $this->form->getState();

if (! Auth::attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false)) {
$this->throwFailureValidationException();
}

$user = Filament::auth()->user();

if (
($user instanceof FilamentUser) &&
(! $user->canAccessPanel(Filament::getCurrentPanel()))
) {
Filament::auth()->logout();

$this->throwFailureValidationException();
}

session()->regenerate();

dd('ee');

return app(LoginResponse::class);
}
seems like Auth::attempt($this->getCredentialsFromFormData($data), $data['remember'] ?? false) also throwing the error @Dennis Koch
Dennis Koch
Dennis Koch8mo ago
So does everything work without this change?
Umar Farooq
Umar Farooq8mo ago
no getting error
Dennis Koch
Dennis Koch8mo ago
Then it's likely not your change.
Umar Farooq
Umar Farooq8mo ago
why http://localhost:8000/livewire/update failing?
No description
Umar Farooq
Umar Farooq8mo ago
I debug the app
// If we have an event dispatcher instance set we will fire an event so that
// any listeners will hook into the authentication events and run actions
// based on the login and logout events fired from the guard instances.
$this->fireLoginEvent($user, $remember);
// If we have an event dispatcher instance set we will fire an event so that
// any listeners will hook into the authentication events and run actions
// based on the login and logout events fired from the guard instances.
$this->fireLoginEvent($user, $remember);
fireLoginEvent creating the issue $this->events?->dispatch(new Login($this->name, $user, $remember));
pythonista
pythonistaOP8mo ago
I changed the livewire update endpoint by registering new endpoint using Livewire::setUpdateRoute() and now it working
No description
pythonista
pythonistaOP8mo ago
Laravel
Installation | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Want results from more Discord servers?
Add your server