Skip to content

Component functions for REST API and GraphQL #564

Description

@xmelic8

Transitioning to Laravel Auth is great. However, implementing functions directly into components is unfortunate. These functions can't be used when creating REST API and GraphQL interfaces, which leads to unnecessary duplication of logic.

Wouldn't it be better to separate the logic common to components and APIs into a separate class? For example, password reset requests use PasswordBroker. The User class implements a trait with the function sendPasswordResetNotification(). Although there is a setUrlForPasswordReset() function available, I don't see a way to call it if I want to use REST API and don't have a resetPassword component in the CMS. I would also prefer to send the email through the queue. But how can I override the sendPasswordResetNotification function in this trait?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions