Sqid route model binding #431
Unanswered
mxaGianluca
asked this question in
Q&A
Replies: 1 comment 1 reply
-
For completeness: I've also tried this as a workaround: use App\Models\TodoItem;
class TodoItemsController
{
/**
* @param string $item The todo item being updated.
*/
public function update(Request $request, TodoItem $item)
{
// ...
}
} But this no longer seems to be working and conflicts with static analysis tools like Larastan. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, first of all thank you for creating an amazing package.
I was wondering about the following, i'm using this package: laravel-sqids which adds a route model binding based on a dynamic property
$model->sqid
.(this means it's not visible in the migrations, so i'm guessing dedoc isn't able to infer it's type via dbal, please correct me if i'm wrong)
And i have the following route
api/news/{item}
and in the controller the $item resolves to a model which uses thelaravel-sqids
trait.I was checking out this code RequestEssentialsExtension.php and it seems that you've included a specific rule for models using the
HasUuids
trait.What would be the recommended way for me to write a custom plugin to do ensure that sqids are correctly inferred as strings?
Beta Was this translation helpful? Give feedback.
All reactions