Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0] Make this package ORM agnostic #42

Closed
3 of 4 tasks
soltmar opened this issue Jun 16, 2023 · 1 comment
Closed
3 of 4 tasks

[2.0] Make this package ORM agnostic #42

soltmar opened this issue Jun 16, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@soltmar
Copy link

soltmar commented Jun 16, 2023

Please check these requirements

  • This feature helps everyone using this package
  • It's feasible and maintainable
  • It's non breaking
  • I issued a PR with the implementation (optional)

Description

Hi @DarkGhostHunter ,

I've been using your Larapass package, since it's abandoned now I tried to use this one.
I'm using Laravel-doctrine/orm package which means that I'm not relaying on Eloquent.

With previous package I was able to easily implement contracts, etc. but since current contracts are forcing return types to strictly Eloquent related, I'm not able to implement contracts without Model usage.

I think it's mostly about WebAuthnAuthenticatable contract and it's webAuthnCredentials returning MorphMany which I'm not able to use in doctrine world :)

Are there any plans to make this package more open ?

Thanks

Code sample

interface WebAuthnAuthenticatable
{
    /**
     * Returns displayable data to be used to create WebAuthn Credentials.
     *
     * @return array{name: string, displayName: string}
     */
    public function webAuthnData(): array;

    /**
     * Removes all credentials previously registered.
     *
     * @param  string  ...$except
     * @return void
     */
    public function flushCredentials(string ...$except): void;

    /**
     * Disables all credentials for the user.
     *
     * @param  string  ...$except
     * @return void
     */
    public function disableAllCredentials(string ...$except): void;

    /**
     * Makes an instance of a WebAuthn Credential attached to this user.
     *
     * @param  array  $properties
     * @return \Laragear\WebAuthn\Models\WebAuthnCredential
     */
    public function makeWebAuthnCredential(array $properties): WebAuthnCredential;

    /**
     * Returns a queryable relationship for its WebAuthn Credentials.
     *
     * @phpstan-ignore-next-line
     * @return \Illuminate\Database\Eloquent\Relations\MorphMany|\Laragear\WebAuthn\Models\WebAuthnCredential
     */
    public function webAuthnCredentials(): MorphMany;
}
@soltmar soltmar added the enhancement New feature or request label Jun 16, 2023
@DarkGhostHunter
Copy link
Contributor

Sorry @soltmar, but I have no plans to make it ORM agnostic.

If that's what you need, you may try the one by Sponky.

@DarkGhostHunter DarkGhostHunter closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants