The database stores information about co-executors and observers in the form '-1-10-20-30-40-50-60-" this is the user_id of the user. How can I check with such data whether the user is in this list and whether he can view the content?
$tasks = Tasks::with('uprcomp','street','houses', 'otvets', 'created_user')
->where('status','0')
->where(function($query) use ($user_id) {
$query->where('user_id',$user_id)
->orWhere('f8820',$user_id) // Responsible
->orWhere('f8830',$user_id) // Observers
->orWhere('f8840',$user_id) // Co - executors
->orWhere('f11580',$user_id); // Observers
})
->orderBy('id', 'desc')->paginate(25);
Thanks!