Eager loading users with roles and groups in the control panel (eloquent repository) #6392
-
Hello, I've follow the statamic.dev/tips to store users in in database. It works fine but when the cp shows users, it performs one request per user displayed to load the role and another one to load the group. I'm new to Statamic/Laravel but I tried to add in App\Models\User: protected $with = ['roles', 'groups'] But it did not help. Is there a way to reduce the amount of SQL requests ? Bonus question: is there a way to generate automagically a migration when I change the user blueprint ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@flyingeek there are some performance improvements in this PR which should reduce the number of request: #5686
Unfortunately not! |
Beta Was this translation helpful? Give feedback.
@flyingeek there are some performance improvements in this PR which should reduce the number of request: #5686
Unfortunately not!