Cartalyst\Sentinel\Sentinel::getUser PHP Метод

getUser() публичный Метод

Returns the currently logged in user, lazily checking for it.
public getUser ( boolean $check = true ) : Cartalyst\Sentinel\Users\UserInterface
$check boolean
Результат Cartalyst\Sentinel\Users\UserInterface
    public function getUser($check = true)
    {
        if ($check === true && $this->user === null) {
            $this->check();
        }
        return $this->user;
    }

Usage Example

Пример #1
0
 /**
  * @param View $view
  */
 public function compose(View $view)
 {
     $view->with('currentUser', $this->sentinel->getUser());
     $view->with('mode', array_get($view->getData(), 'mode', ''));
     $view->with('breadcrumbs', config('shapeshifter.breadcrumbs') ? $this->breadcrumbService->breadcrumbs() : []);
     $view->with('menu', $this->menuService->generateMenu());
 }
All Usage Examples Of Cartalyst\Sentinel\Sentinel::getUser