I use check: @if(Auth::user()->hasRole(['administrator']))...@endif multiple time at the same template, i get 10 selects from database select roles.*, role_user.user_id as pivot_user_id, role_user.role_id as pivot_role_id from roles inner join role_user on roles.id = role_user.role_id where role_user.user_id = '1'. Can I do this select once time? P.S.: I check user roles in different place and cannot group them. Thanks!!
I use check: @if(Auth::user()->hasRole(['administrator']))...@endif multiple time at the same template, i get 10 selects from database select
roles.*,role_user.user_idaspivot_user_id,role_user.role_idaspivot_role_idfromrolesinner joinrole_useronroles.id=role_user.role_idwhererole_user.user_id= '1'. Can I do this select once time? P.S.: I check user roles in different place and cannot group them. Thanks!!