$user->hasRole($role)
Checks if the user has a particular role.
-
return (boolean)
Example
<?php if($user = $site->user() and $user->hasRole('editor')): ?>
This super secret content is only visible for editors
<?php endif ?>
Checks if the user has a particular role.
<?php if($user = $site->user() and $user->hasRole('editor')): ?>
This super secret content is only visible for editors
<?php endif ?>