Answer the question
In order to leave comments, you need to log in
How to solve the out-of-memory error when executing such a query?
Good afternoon!
The goal is to get a list of all permissions for a given model instance(s).
I make such a command in the controller method and I get an out of memory error.
BigTask::where('id', $id)->with(['modules.groups.permissions' => function ($q) use (&$permissions) {
$permissions = $q->get()->unique();
}])->first();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question