sagar-s-bhedodkar / auto-reset
Automate `php artisan migrate:fresh` + seeding + cleanup for local Laravel development environments.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/sagar-s-bhedodkar/auto-reset
Requires
- php: >=8.1
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0
- phpunit/phpunit: ^9.5
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.