/** * @return $this */ public function home() { if (Confide::User()) { $this->dsp->content = Confide::user()->getContent(); } return View::make('dispatch')->with(['dsp' => $this->dsp]); }
public function __construct() { // Fetch the User object, or set it to false if not logged in if (Confide::User()) { $this->logged_in_user = Confide::User(); } else { $this->logged_in_user = false; } View::share('logged_in_user', $this->logged_in_user); View::share('success_message', $this->success_message); }
/** * Retrieving the email of current logged-in user . * The "authAdapter" directive into config.php defines which Authentication * adapter is use in current app . * Currently , this package supports three adapters (Auth , Sentry and Confide) * As a fallback measure , a third option can be used while calling the Class * Gravatar::get( null , false , '*****@*****.**') * @return void * */ protected function getEmail() { $authAdapter = Config::get('laravel4-getgravatar::authAdapter'); switch (strtolower($authAdapter)) { case 'sentry': if (Sentry::check()) { $this->email = Sentry::getUser()->email; } break; case 'confide': if (Confide::user()) { $this->email = Confide::User()->email; } break; case 'auth': if (Auth::check()) { $this->email = Auth::User()->email; } break; default: $this->email = null; } }