jeudi 15 août 2019

Hide the data of a user which has the same "Role"

For the role Former, I have 2 users. For example Eric wants to see his private informations. He can see the private informations of Jean. It's a problem...

enter image description here

Can I block that

I have tried this but without success:

$has_role = auth()->user()->hasRole('former'); 

$user = User::when($has_role, function ($query) {
    return $query->where('email', auth()->user()->email);
})
->get();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire