Skip to content

CanRegister ​

Namespace: Unusualify\Modularous\Entities\Traits\Auth\CanRegister

Plugs the User model into the email-verification registration flow managed by the Register facade and RegisterBrokerManager. Implements the two contract methods required by RegisterBroker.


Methods ​

MethodSignatureDescription
getEmailForRegister(): stringReturns the email address to send the verification link to ($this->email)
sendRegisterNotification(string $token, array $parameters = []): voidDispatches the EmailVerification notification (or a custom class from modularous.verification_email_class)

Configuration ​

Config keyDefaultDescription
modularous.verification_email_classEmailVerification::classNotification class used for the verification email

Usage ​

This trait is placed on the User model. You rarely call these methods directly — they are invoked internally by RegisterBrokerManager when Register::sendResetLink() is called.

php
use Unusualify\Modularous\Entities\Traits\Auth\CanRegister;

class User extends Authenticatable
{
    use CanRegister;
}

// Triggered internally by the Register facade:
// Register::sendResetLink(['email' => $user->email]);
// → $user->sendRegisterNotification($token);

See the Register facade → for the full registration flow.