laravel-user-commands maintained by sergeybruhin
Laravel User Commands Package
Artisan commands to create, delete, and change passwords for Laravel users.
Installation
You can install the package via composer:
composer require sergeybruhin/laravel-user-commands
Optionally publish the config:
php artisan vendor:publish --provider="SergeyBruhin\LaravelUserCommands\Providers\LaravelUserCommandsServiceProvider" --tag="config"
Commands
users:create
Creates a new user. Prompts interactively if options are omitted. Sets email_verified_at automatically.
# Interactive
php artisan users:create
# Non-interactive
php artisan users:create --name="John Doe" --email="john@example.com" --password="secret123"
users:change-password
Changes the password of an existing user. When run without --password, prompts for the new password and a confirmation.
# Interactive
php artisan users:change-password
# Non-interactive
php artisan users:change-password --email="john@example.com" --password="newpassword"
users:delete
Deletes an existing user. Shows user details and asks for confirmation unless --force is passed.
# Interactive (with confirmation prompt)
php artisan users:delete
# Target a specific user
php artisan users:delete --email="john@example.com"
# Skip confirmation
php artisan users:delete --email="john@example.com" --force
Configuration
// config/laravel-user-commands.php
return [
'user_model' => \App\Models\User::class,
'min_password_length' => 6,
];
| Key | Default | Description |
|---|---|---|
user_model |
App\Models\User |
Eloquent model used for all user operations. |
min_password_length |
6 |
Minimum character length enforced on create and change-password. |
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email sundaycreative@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.