A Laravel package for handling client authentication with mini app login functionality.
- Add the package to your Laravel project:
composer require client-for-authentication-provider/client-for-authentication-provider- Publish the configuration file:
php artisan vendor:publish --tag=client-for-authentication-provider-config- Publish the routes (optional):
php artisan vendor:publish --tag=client-for-authentication-provider-routes- Publish the controllers (optional):
php artisan vendor:publish --tag=client-for-authentication-provider-controllersThe package configuration file is located at config/client-for-authentication-provider.php. You can customize the following options:
default_role_id: Default role ID for new users (default: 2)default_country_code: Default country code (default: '+92')default_country_iso_code: Default country ISO code (default: 'PK')provider_name: Provider name (default: 'Bullseye')route_prefix: Route prefix (default: 'api')route_middleware: Route middleware (default: 'api')
The package provides the following API endpoint:
POST /api/create-or-login-user
{
"user_data": {
"email": "user@example.com",
"mobile": "1234567890",
"first_name": "John",
"last_name": "Doe",
"country_code": "+92",
"country_iso_code": "PK",
"password": "password123"
}
}{
"success": true,
"token": "1|abc123...",
"data": {
"id": 1,
"name": "John Doe",
"email": "user@example.com",
"phone": "1234567890",
// ... other user fields
}
}If you want to customize the controllers, publish them to your application:
php artisan vendor:publish --tag=client-for-authentication-provider-controllersThe controllers will be published to app/Http/Controllers/ClientForAuthenticationProvider/.
If you want to customize the routes, publish them to your application:
php artisan vendor:publish --tag=client-for-authentication-provider-routesThe routes will be published to routes/client/authentication-provider.php.
- PHP >= 8.2
- Laravel >= 10.0
- Laravel Sanctum
This package is open-sourced software licensed under the MIT license.