Replies: 6 comments 8 replies
-
Did you try returning false ? |
Beta Was this translation helpful? Give feedback.
-
What exactly do you mean by "cancel the fetch"? What is the expected result of that? If you're trying to prevent access to a model in the afterFetch event just throw an ApplicationException |
Beta Was this translation helpful? Give feedback.
-
You mean in the List controller? |
Beta Was this translation helpful? Give feedback.
-
If so, read this: And this |
Beta Was this translation helpful? Give feedback.
-
In frontend component this example works $collection = MyModel::where('active', true)->get();
I need to do the same thing but in the beforeFetch event of the model |
Beta Was this translation helpful? Give feedback.
-
Ok. Thank you for your answers.
|
Beta Was this translation helpful? Give feedback.
-
Can i cancel the fetch of a model by using the afterFetch or beforeFetch events
public function beforeFetch() { if ($this->atrribute == 'example'){ //cancel fetch } }
Beta Was this translation helpful? Give feedback.
All reactions