- Is that the only Route defined for
'invoices/{invoice}'URI; e.g. do you have ainvoices.showroute also? - Do you have a Policy registered for the Invoice model?
- I removed a middleware - what middleware? Show us the relevant code.
403 on live server, not on local
All of a sudden my live server starts to throw a 403, but only when calling a single route. Everything else works fine. Log is empty.
Link:
<a href="{{ route('invoices.edit', $invoice) }}">Edit</a>
Route (I removed a middleware, still 403):
Route::get('invoices/{invoice}', \App\Livewire\Invoices\Form::class)->name('invoices.edit');
I've put die('here') in the mount() and that shows on my local machine but on my live server it's still a 403. Any idea how I can narrow this problem down?
I'm on PHP 8.2, Laravel 11.20.0 Livewire 3
@muuucho if you are not signed in, you will not have a User instance so the Gate will deny access.
Also, there is no way to get to the invoices.show Route, because the edit action will always be matched first.
Route::get('invoices/{invoice}', \App\Livewire\Invoices\Form::class)->name('invoices.edit');
Route::get('invoice/{id}', \App\Livewire\Invoices\Show::class)->name('invoices.show');
By convention, the URL segments for the edit action is invoices/{invoice}/edit'
Please or to participate in this conversation.