Moderators joeri Posted May 3, 2015 Moderators Report Share Posted May 3, 2015 hey all i wanted to create sertain pages but only visible for a select user group in my dropdown. i tried it with a modified version i found here on the forum but no luck annybody care to help me out here. thanks Quote Link to comment Share on other sites More sharing options...
magicflyer Posted May 3, 2015 Report Share Posted May 3, 2015 Auth::UserInGroup($groupname); Would return a boolean, either true or false pertaining to whether a logged in user is in a group or not. Use it accordingly within an if statements as such: if(Auth::UserInGroup('retired_pilots')){ echo "User is retired"; } Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted May 3, 2015 Author Moderators Report Share Posted May 3, 2015 hey thanks i tried this <?php if(Auth::UserInGroup($Aero Club)); { if(Auth::UserInGroup('Aero Club')) { echo '<a href="<?php echo url('/content/aeroclub/'); ?>">Aero Club</a> '; } ?> <?php } ?> but its giving me an T string error on the first line Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted May 3, 2015 Author Moderators Report Share Posted May 3, 2015 fixed it :-) Quote Link to comment Share on other sites More sharing options...
Sava Posted May 3, 2015 Report Share Posted May 3, 2015 (edited) if(Auth::UserInGroup($Aero Club)); Delete the semicolon ( edit: Just noticed you fixed it...sorry Edited May 3, 2015 by Sava Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.