Barryvdh\Debugbar\DataCollector\AuthCollector::getUserInformation PHP Метод

getUserInformation() защищенный Метод

Get displayed user information
protected getUserInformation ( Illuminate\Auth\UserInterface $user = null ) : array
$user Illuminate\Auth\UserInterface
Результат array
    protected function getUserInformation($user = null)
    {
        // Defaults
        if (is_null($user)) {
            return ['name' => 'Guest', 'user' => ['guest' => true]];
        }
        // The default auth identifer is the ID number, which isn't all that
        // useful. Try username and email.
        $identifier = $user->getAuthIdentifier();
        if (is_numeric($identifier)) {
            try {
                if ($user->username) {
                    $identifier = $user->username;
                } elseif ($user->email) {
                    $identifier = $user->email;
                }
            } catch (\Exception $e) {
            }
        }
        return ['name' => $identifier, 'user' => $user instanceof Arrayable ? $user->toArray() : $user];
    }