sagar-s-bhedodkar/auto-reset
最新稳定版本:v1.0.1
Composer 安装命令:
composer require --dev sagar-s-bhedodkar/auto-reset
包简介
Automate `php artisan migrate:fresh` + seeding + cleanup for local Laravel development environments.
README 文档
README
Automate php artisan migrate:fresh + seeding + cleanup for local Laravel development environments.
Table of Contents
Introduction
Laravel AutoReset is a simple yet powerful package designed to automate repetitive database reset tasks during local development.
Instead of running multiple commands (migrate:fresh, db:seed, cache:clear, etc.), you can now do it all with a single command:
php artisan dev:reset
This improves your development workflow, reduces human errors, and saves time.
Features
- Reset the database and run migrations automatically.
- Seed database optionally with default or specific seeders.
- Clear cache, configuration, and views automatically.
- Optional cleanup of storage directories.
- Environment safety: works only in local or testing environments.
- Works with Laravel 9, 10, 11, and 12.
Installation
- Navigate to your Laravel project:
cd your-laravel-project
- Require the package:
- From GitHub (if not on Packagist yet):
composer require sagar-s-bhedodkar/auto-reset:*@dev
- From Packagist (once published):
composer require sagar-s-bhedodkar/auto-reset
- Publish the configuration (optional):
php artisan vendor:publish --provider="Laravel\AutoReset\Providers\AutoResetServiceProvider" --tag=config
Configuration
After publishing, edit config/auto-reset.php to:
- Set default seeders.
- Configure storage directories to clean.
- Enable/disable post-reset commands.
Example:
return [ 'default_seeders' => [ \Database\Seeders\UserSeeder::class, \Database\Seeders\ProductSeeder::class ], 'storage_cleanup' => true, 'cleanup_paths' => ['storage/app/public'], ];
Usage
Run the main command:
php artisan dev:reset
Optional arguments:
- Run specific seeders:
php artisan dev:reset --seed=UserSeeder,ProductSeeder
- Clean storage directories:
php artisan dev:reset --storage
- The command never runs in production for safety.
Contributing
- Fork the repository.
- Create a new branch:
git checkout -b feature/my-feature
- Make your changes, write tests, and commit:
git commit -m "Add feature XYZ"
- Push to your fork:
git push origin feature/my-feature
- Open a Pull Request.
All contributions are welcome!
License
This package is licensed under MIT License – see the LICENSE file for details.
Support
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-12