php - Laravel Roles and authentication to routes -


i looking archive the following

userlogs in -> assigned privilege db -> can see allowed routes only

so far have been able reach here:

$user = usercredential::where('username','=',auth::user()->username)->get();  foreach ($user $u ) {          $status = $u->userstatus;         $userpriv = $u->userpriviledge;          if ($status == 0){                              session::put('user_priv',$userpriv);             }         else{                     return redirect::to_route('home')->with('message','inactive users cannot login');             } 

which checks status of user if active or inactive stores priviledge in session. next? how protect routes?

thanks

i recommend laravel 4 package called: entrust provide way add role-based


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -