Download the PHP package backstage/laravel-users without Composer
On this page you can find all versions of the php package backstage/laravel-users. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download backstage/laravel-users
More information about backstage/laravel-users
Files in backstage/laravel-users
Package laravel-users
Short Description This is my package laravel-users
License MIT
Homepage https://github.com/backstage/laravel-users
Informations about the package laravel-users
Laravel Users
A modern user management package for Laravel, built by Backstage.
β¨ Introduction
backstage/laravel-users is a full-featured Laravel package that provides a complete user management foundation for Laravel 10 & 11 applications. It leverages Laravel Sanctum and Spatie Permissions to deliver robust authentication, authorization, and user preference handling.
This package includes support for user login tracking, traffic monitoring, preferences, factory seeding, and customizable scaffoldingβall designed to scale with your application.
π¦ Features
- β Custom user model with Laravel Auth integration
- π Role and permission support via Spatie Laravel Permission
- π API token authentication via Laravel Sanctum
- π§ Configurable user system with feature toggles
- π§ͺ Built-in factory and seeder
- π Tracks login events and traffic history
- π§© Modular architecture with domain-driven design (DDD) patterns
- π Artisan commands for user management (
make,list,delete) - π¨ Email-based username generation
- π Password generation utility
- π§ Customizable notification & sub-navigation preferences
π§° Requirements
- PHP ^8.2
- Laravel ^10.0 or ^11.0
- Composer
βοΈ Installation
Install via Composer:
Publish configuration, migration, and seeder files:
Run database migrations:
π Configuration
1. Set the User Provider
Update config/auth.php to use the package's custom user model:
2. Enable Sanctum API Tokens
If you haven't already:
3. Setup Spatie Permissions
Ensure Spatie permissions are published:
Edit config/permission.php to adjust your roles and permission settings.
π§© Customization
You can modify config/users.php to change:
- Default roles
- Middleware behavior
- Feature toggles (registration, email verification, etc.)
- UI scaffolding paths (if applicable)
π§βπ» Artisan Commands
The package includes a suite of CLI tools:
| Command | Description |
|---|---|
artisan make:user |
Create a new user interactively |
artisan users:list |
List users in a table format |
artisan users:delete |
Delete a user by ID or email |
Example:
π§± Architecture
Key Classes
- UserManager: Central config-driven service for runtime overrides
- Domain/Email/Actions:
GenerateUsernameFromEmailExtractDomainFromEmailValidateEmail
- Domain/Password/Actions:
GeneratePassword
- Eloquent/Concerns/User:
- Modular traits like
HasAttributes,HasScopes,HasRelations
- Modular traits like
- Models:
User,UserLogin,UserTraffic,UserNotificationPreferences
Migrations Included
- Adds sub-navigation and notification preferences to users
- Tracks user logins and traffic history
- Supports nullable password for third-party auth
π§ͺ Testing
Run PHPUnit tests via:
Ensure your .env.testing or phpunit.xml is configured with a test database.
π¬ Development
Local Package Development
If you're contributing or using this in a monorepo:
- Clone the package into
packages/or your preferred folder -
Add this to your Laravel app's
composer.json: -
Require the package:
- Refresh autoload:
π€ Contributing
Contributions are welcome! Please follow the PSR-12 coding standard and submit pull requests with clear descriptions.
π License
This package is open-sourced software licensed under the MIT license.
π€ Author
Manoj Hortulanus
Developer at Backstage
π§ [email protected]
π Credits
All versions of laravel-users with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version >=10.0
spatie/laravel-permission Version >=6.0
lorisleiva/laravel-actions Version >=2.8