php - Handling different session profiles in Laravel 4 -


i'm developing system , have different profiles same view page information different regarding user information, when specific user login, user can open user profile other guest user can see specific information because not owner of profile.

for example:

  • mysite.com/user/user_1
  • mysite.com/user/user_2

if user_1 login, can see full profile , if visit profile of user_2 can see information, , viceversa.

i can't apply basic before auth filter because not 1 user can login in system.

i suppose can't apply basic auth, because if 1 user login can see profiles , information filtering auth if logged or not.

public function __construct()  {     $this->beforefilter('auth', array('only'=>array('getprofile')));     $this->beforefilter('auth', array('only'=>array('getsettings')));     ... }  public function getprofile() {      $user_information = //get_from_database     return $this->layout->content = view::make('user.profile')         ->with('user',$user_information);  }  public function getsettings() {      $user_information = //get_from_database     return $this->layout->content = view::make('user.settings')         ->with('user',$user_information);  } 

so, want know if exists way in laravel. regards!


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -