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...
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