Closed pa2codes closed 2 months ago
Hey there,
Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.
Thanks!
Volt Version
1.0.0
Laravel Version
11.3
PHP Version
8.2
Database Driver & Version
MySQL 8 MacOS Sail
Description
I am trying to add Policy check to my Volt::route(), however Model Binding seems not to work for my Models using Uuid as primary key type for Volt route. Using standard Laravel Routing works as expected. Using authorize() in my Volt Component also works fine.
$this->authorize('view', $product);
I tried middleware() as well as can() on Volt route.
Product migration
Product Model
ProductPolicy
routes/web.php
Gate check returns 403
I am not sure if I am missing sth or of its a Volt bug. Appreciate your help! Thanks
Steps To Reproduce
1) Create Product Model with Uuid as primary key 2) Create ProductPolicy 3) Create Livewire Volt Component 4) Create Volt::route('/product/{product}', 'product-view') with middleware('can:view,product')