dive-be / laravel-wishlist

Manage your users' wishes in your Laravel app
MIT License
5 stars 2 forks source link

Strict types conflict if models primary key is integer #3

Closed liepumartins closed 2 years ago

liepumartins commented 2 years ago

Dive\Wishlist\WishCollection::findModel(): Argument #2 ($id) must be of type string, int given, called in /home/vagrant/test/vendor/dive-be/laravel-wishlist/src/WishCollection.php on line 36

Happens when route binding or simply calling:

Dive\Wishlist\Facades\Wishlist::find('09c09144-42fd-47b2-98b9-396687eb23ca')

Likely because the Eloquent model has $casts = ['id'=>'int']; for unrelated reasons.

mabdullahsari commented 2 years ago

Closed by #4

mabdullahsari commented 2 years ago

Fix released as 1.2.1. Thanks for the PR!