public function createToken(?Authenticatable $user, ?string $email = null) : Model
    {
        if ($user === null) {
            throw new NullValueException("User cannot be null");
        }

        $email = $email ?? $user->email;

        if ($this->canInsertToken($user, $email)) {
            return $this->insertToken($user, $this->generateToken($this->config->get('app.key')), $email);
        }

        throw new InvalidPermissionException('Cannot create token');
    }