Download the PHP package cofa/laravel-authentication-flow without Composer
On this page you can find all versions of the php package cofa/laravel-authentication-flow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cofa/laravel-authentication-flow
More information about cofa/laravel-authentication-flow
Files in cofa/laravel-authentication-flow
Package laravel-authentication-flow
Short Description Simple authentication flow with validation and flexibility of credentials so you can use phone, email whatever you want .
License MIT
Informations about the package laravel-authentication-flow
Laravel Authentication Flow
A simple and flexible authentication package for Laravel applications with JWT support. This package provides a complete authentication flow with login, registration, token refresh, and logout functionality.
Features
- JWT-based authentication
- Login and registration endpoints
- Token refresh mechanism
- Secure logout with token blacklisting
- Configurable token expiration times
- Flexible credential validation
Requirements
- PHP 8.2 or higher
- Laravel 12.x
- Tymon JWT Auth package
Installation
1. Install the package via Composer
2. Configuration (Optional)
The package comes with default configuration that will be automatically merged. If you want to customize the settings, publish the configuration file:
This will create a config/apiauth.php file in your application that you can modify.
JWT Configuration
1. JWT Setup
The tymon/jwt-auth package is automatically installed as a dependency. Laravel will handle the provider registration automatically.
2. Generate JWT Secret Key
Generate a secret key for JWT:
This will update your .env file with a JWT_SECRET value.
3. Configure Auth Guard
Update your config/auth.php file to use the JWT guard:
4. Update User Model
Update your User model to implement the JWT interface:
Configuration Options
You can customize the authentication behavior by modifying the config/apiauth.php file:
Usage
The package provides the following API endpoints:
Authentication Routes
All routes are prefixed with /auth:
POST /auth/login- Login with credentialsPOST /auth/register- Register a new userPOST /auth/refresh-token- Refresh access tokenPOST /auth/logout- Logout and invalidate tokens
Example Requests
Login
Response:
Refresh Token
Response:
Security
This package implements several security features:
- Password validation with complexity requirements
- Token blacklisting for logout
- Separate access and refresh tokens
- Configurable token lifetimes
License
This package is open-sourced software licensed under the MIT license.
All versions of laravel-authentication-flow with dependencies
php Version ^8.2
illuminate/support Version ^12.22.1
illuminate/routing Version ^12.22.1
propaganistas/laravel-phone Version ^6.0
illuminate/auth Version ^12.22