Skip to content

Register ​

Facade: Unusualify\Modularous\Facades\Register
Accessor: auth.register
Underlying: Unusualify\Modularous\Brokers\RegisterBrokerManager

Extends Laravel's Password facade to provide an email-verification-based registration flow. Works like Password::broker() but for the registration verification pipeline.

Constants ​

ConstantValue description
VERIFIED_EMAIL_REGISTERRegistration completed successfully after email verification
VERIFICATION_LINK_SENTVerification email sent — user must click the link
ALREADY_REGISTEREDThe email address is already registered
INVALID_VERIFICATION_TOKENThe verification token is invalid or expired
VERIFICATION_THROTTLEDToo many verification attempts — throttled

Methods ​

Inherits the full Password facade interface plus:

MethodSignatureDescription
broker(string|null $name = null): PasswordBrokerResolves the registration broker
sendResetLink(array $credentials, ?Closure $callback = null): stringSends a verification/registration link
reset(array $credentials, Closure $callback): mixedCompletes registration with a valid token
getUser(array $credentials): CanResetPassword|nullResolves the user from credentials
createToken(CanResetPassword $user): stringCreates a verification token
deleteToken(CanResetPassword $user): voidDeletes a user's verification token
tokenExists(CanResetPassword $user, string $token): boolChecks if a token is valid

Usage ​

php
use Unusualify\Modularous\Facades\Register;

$status = Register::sendResetLink(['email' => $request->email]);

if ($status === Register::VERIFICATION_LINK_SENT) {
    return back()->with('status', 'Verification email sent.');
}

if ($status === Register::ALREADY_REGISTERED) {
    return back()->withErrors(['email' => 'This email is already registered.']);
}

Notes ​

  • Backed by RegisterBroker / RegisterBrokerManager, which follow the same interface as Laravel's password broker.
  • The auth.register container binding is registered by BaseServiceProvider.
  • See Brokers → for broker-layer internals.