I have some model Task
.
If current user has permission then he can see all tasks
return Task::all();
If current user does not have this permission then he can see only empty list
return Task::where('id', 0)->get();
Design is so that user must always get some result, but my functions work with data returned from Task::all()
so I can not return empty array or empty Eloquent collection.
What should I do?
via Jackson J