A flexible, drop-in authentication package for Laravel applications, featuring Magic Links and standard Password authentication. No JavaScript required.
- Magic Link Authentication: Secure, passwordless login via email.
- Password Authentication: Traditional email/password flow with Forgot Password functionality.
- Security First: Rate limiting, timing attack protection, and secure URL signing.
- Agnostic Views: Clean, unstyled Blade views (Tailwind-ready classes) that inherit your app's design.
- Internationalization: Fully translatable UI strings.
- Configurable: Extensive configuration for methods, redirects, and user models.
composer require davidgut/simple-authTo customize config/simple-auth.php, publish the configuration file:
php artisan vendor:publish --tag="simple-auth-config"To customize the login and signup pages, publish the views:
php artisan vendor:publish --tag="simple-auth-views"To customize the text strings, publish the language files:
php artisan vendor:publish --tag="simple-auth-lang"To ensure the login pages are styled correctly, publish the package assets (compiled Tailwind CSS):
php artisan vendor:publish --tag="simple-auth-assets"You can configure the package by adding the following variables to your .env file:
SIMPLE_AUTH_DEFAULT_METHOD=password
SIMPLE_AUTH_MAGIC_LINK_ENABLED=true
SIMPLE_AUTH_MAGIC_LINK_TTL=15
SIMPLE_AUTH_PASSWORD_ENABLED=true
SIMPLE_AUTH_REDIRECT_AFTER_LOGIN=/
SIMPLE_AUTH_REDIRECT_AFTER_LOGOUT=/The package registers the following routes automatically:
GET /login- Login pagePOST /login/{method}- Process loginGET /signup- Signup pagePOST /signup- Process signupPOST /logout- LogoutGET /forgot-password- Request password reset linkPOST /forgot-password- Send password reset linkGET /reset-password/{token}- Reset password formPOST /reset-password- Update password
The views are available at resources/views/vendor/simple-auth after publishing. They use standard Tailwind CSS classes and link to the published simple-auth.css.
All text strings are translatable. After publishing, you can find them in resources/lang/vendor/simple-auth.
Run the test suite:
./vendor/bin/pestThe MIT License (MIT).