पेज · Laravilt
Configuration
Enable auth features on a panel and configure the laravilt-auth config file.
You enable authentication features per panel with methods on the Panel object. The config file holds package-wide defaults.
Panel methods
Every page-based method accepts an optional custom page class and URL path, for example login(?string $page = null, ?string $path = null).
| Method | Default path | What it enables |
|---|---|---|
login() | login | Login page and logout route |
registration() | register | Registration page |
passwordReset() | forgot-password | Forgot password and reset-password/{token} pages |
emailVerification() | verify-email | Email verification notice and signed verify link |
otp() | otp | One-time code verification page |
magicLinks() | magic-link | Passwordless login by emailed link |
twoFactor(?string $page, ?string $path, ?callable $builder) | profile/two-factor | Two-factor authentication (see Two-Factor) |
socialLogin(Closure|array $config) | auth/{provider}/... | OAuth login (see Social Login) |
passkeys() | profile/passkeys | Passkey management and passkey login |
profile() | profile | Profile page |
sessionManagement() | profile/sessions | Active sessions page |
apiTokens() | profile/api-tokens | Sanctum API token page |
connectedAccounts() | profile/connected-accounts | Link or unlink social accounts |
localeTimezone() | settings/locale-timezone | Language and timezone preferences |
Related panel methods:
disableTwoFactor()anddisableSocialLogin()switch those features off again.requirePasswordForSocialLogin(bool $require = true)sends users who signed up through a social provider to a set-password page until they choose a password. It is on by default.
Custom pages and paths
php
A custom page class should extend the matching class in Laravilt\Auth\Pages, for example Laravilt\Auth\Pages\Login.
Config file
Publish config/laravilt-auth.php to change the defaults:
bash
php
Panel methods decide which features a panel actually shows. Configure the panel first and use the config file for shared defaults.
Publish tags
| Tag | Publishes |
|---|---|
laravilt-auth-config | config/laravilt-auth.php |
laravilt-auth-migrations | Migrations (they also load automatically without publishing) |
laravilt-auth-views | Frontend pages for your stack (Vue or React) to resources/js/pages/laravilt/auth |
laravilt-auth-blade-views | Blade views, such as mail templates |
laravilt-auth-assets | Compiled assets |
React support requires Laravilt v1.1 or later.
Artisan commands
bash