Replies: 1 comment 7 replies
-
Hey @bojmaliev The performance/relationships issue you describe is something that should also happen in any application, e.g. when using Laravel with blade compoments you should encounter the same issue. So while I unfortunately could not provide any instant solution for you, I recommend reviewing your policy concept and try to optimize the queries. If you are using Laravel, you could also activate I hope this helps a bit to get in the right direction! |
Beta Was this translation helpful? Give feedback.
-
Hello guys!
I love Inertia and I love making applications with Inertia.
Right now I'm working on a project with many Policies and Gates and I'm thinking if there is a better way to do it.
Currently for class based policy methods I'm always appending can attribute to the User. For model based policy methods I'm appending can attribute for every Model.
This is the Inertia's way.
The problem
Currently I have model Ticket with 20+ policy methods and some of them are required to load additional relationships in order to check the policy result.
This results to many loaded models and honestly I don't like it.
Is there any way of making Inertia smarter and lazy load only the policy methods needed for the next page ?
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions