orchidsoftware / crud

Simplify the process of building CRUD (Create, Read, Update, Delete) functionality in Laravel using the features of Orchid.
https://orchid.software
MIT License
137 stars 34 forks source link

Incorrect model passed to policy methods when listing resources #76

Closed giant-robot closed 1 year ago

giant-robot commented 2 years ago

There seems to be an issue when using policies with listing resources.

For each item on the list, the corresponding policy's view() and edit() methods are invoked (as expected). However, the second argument passed to them is an empty model and not the actual item's model instance (ie, it does not have the item's attributes set).

It appears that this can be fixed with limited modifications. What do you think?