Hello
I hope my title doesn't confused you :D
I have a table called "Notifications" which I add my custom notifications in it for specific roles
this is the "Messages" tabel strcuture
id | roles | message
1 | ["superadmin","trial"] | test message
now I want to only users who has "superadmin" role or "trial" role can see this message.
this is my "User" table strcuture
id | roles | name
1 | ["superadmin"] | reysa
2 | ["admin","moderator"] | user
3 | ["trial"] | user 2
how can I do this in eloquent with a where() function? is it possible or I have to go get all the data and then filter them one by one with foreach based on user roles.
I have many roles (almost 11) that's why I want to filter the data with where() while I'm calling the eloquent
thanks in advanced