Replies: 2 comments 3 replies
-
You should type-hint the Not sure about Volt, that may be a limitation in Volt's functionality. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Has this issue been fixed? Just ran into it now in Volt full-page components. // web.php
Volt::route('contact/{contact}', 'pages.admin.contact')
->name('contact.edit')
->can('update', 'contact');
// blade file
new class extends Component
{
public Contact $contact;
public function mount(Contact $contact)
{
$this->contact = $contact;
}
} Policy does not get called (as I do not get logs from the before() hook). class ContactPolicy
{
public function before(Contact $user, string $ability): bool|null
{
Log::debug('was here');
return null;
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Livewire version
v3.4.12
Laravel version
v11.7
Which PHP version are you using?
PHP 8.3
Steps To Reproduce
Repository or Wirebox URL
https://github.com/boptom/volt-route-middleware
Additional information
Using 'can:view,post' in middleware in Volt route or Livewire full page component always returns 403.
Previously reported in the Volt repo here: livewire/volt#104
Please confirm (incomplete submissions will not be addressed)
Beta Was this translation helpful? Give feedback.
All reactions