Efficiently\AuthorityController\ControllerAdditions::getCurrentAuthority PHP Method

getCurrentAuthority() public method

Just define the method in the controller to change behavior. public function getCurrentAuthority() { instead of app('authority'); $this->currentAuthority = $this->currentAuthority ?: app('UserAuthority', [$this->getCurrentAccount()]); return $this->currentAuthority; } Notice it is important to cache the authority object so it is not recreated every time.
public getCurrentAuthority ( )
    public function getCurrentAuthority()
    {
        if (is_null($this->currentAuthority)) {
            $this->currentAuthority = app('authority');
        }
        return $this->currentAuthority;
    }