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

v1.0.1 2025-10-12 08:29 UTC

This package is auto-updated.

Last update: 2025-10-12 09:11:13 UTC


README

License: MIT
Latest Version

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

  1. Navigate to your Laravel project:
cd your-laravel-project
  1. 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
  1. 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

  1. Fork the repository.
  2. Create a new branch:
git checkout -b feature/my-feature
  1. Make your changes, write tests, and commit:
git commit -m "Add feature XYZ"
  1. Push to your fork:
git push origin feature/my-feature
  1. Open a Pull Request.

All contributions are welcome!

License

This package is licensed under MIT License – see the LICENSE file for details.

Support