App\Models\Access\User\Traits\Attribute\UserAttribute::getLoginAsButtonAttribute PHP Method

getLoginAsButtonAttribute() public method

    public function getLoginAsButtonAttribute()
    {
        /**
         * If the admin is currently NOT spoofing a user
         */
        if (!session()->has("admin_user_id") || !session()->has("temp_user_id")) {
            //Won't break, but don't let them "Login As" themselves
            if ($this->id != access()->id()) {
                return '<a href="' . route('admin.access.user.login-as', $this) . '" class="btn btn-xs btn-success"><i class="fa fa-lock" data-toggle="tooltip" data-placement="top" title="' . trans('buttons.backend.access.users.login_as', ['user' => $this->name]) . '"></i></a> ';
            }
        }
        return '';
    }