pllaguno
3 weeks ago

checking a many relationship

Posted 3 weeks ago by pllaguno

right now i am doing this if($credito->subdir_id == Auth()->user()->subdir_id) which is to check if the user has that subdir assigned to it, but i have another case where a user has many subdirs assigned to it.

how can i check this?

Auth()->user()->subdirs()->get() but how do i compare that to $credito->subdir_id?

Please sign in or create an account to participate in this conversation.