Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Custom Fresh

Custom Fresh Laravel Package

ramadan/custom-fresh

A Laravel package that customizes the migrate:fresh workflow, letting you refresh your database while preserving selected tables and controlling seeding. It simplifies resetting development databases without losing essential records, making repeatable local and test setups faster and less destructiv...

View on GitHub
Deep Wiki
Context7

ramadan/custom-fresh is a Laravel package for building tailored database refresh workflows. It extends Laravel’s migrate:fresh experience with a configurable command, making it easy to reset local or testing databases to a consistent, seedable state without one-off scripts.

  • Configurable fresh command for repeatable database resets.
  • Custom seeder hooks for loading required application data.
  • Flexible configuration for different environments and workflows.
  • Simple integration with existing Laravel projects.
Frequently asked questions about Custom Fresh
How do I install ramadan/custom-fresh in a Laravel application?
Install it as a dev dependency with composer require --dev ramadan/custom-fresh, then publish the config file with php artisan vendor:publish if the package ships one. Because it is require-dev only, it never enters your production runtime dependency graph. Confirm Laravel package auto-discovery registers the service provider, or add it manually to your providers list.
How do I configure which tables are excluded from migrate:fresh?
After publishing the config, add the table names you want preserved to the package's exclusion array. Then swap your usual php artisan migrate:fresh call for the package's command in your Makefile or composer scripts. Check in the config whether the list applies globally or per database connection before relying on it across connections.
Which Laravel and PHP versions does custom-fresh support?
That depends on the composer.json constraint and whether a CI test matrix is published, so verify both on the repository rather than assuming. The package hooks into migrate:fresh, whose --drop-views, --drop-types and --seed options have shifted between Laravel 8 and 12. Pin a version and smoke-test on your exact Laravel release before adopting it in a shared workflow.
Does custom-fresh skip the drop or dump and restore the preserved tables?
This is the most important question to answer before adopting it, because the two designs behave very differently. Skipping the drop is faster but silently diverges from migrations when a preserved table gains a column, which is the classic works-on-my-machine failure. Dump and restore keeps rows intact but is slower and can clash with seeders. Check the README or ask the maintainer which approach is implemented.
Which database drivers does custom-fresh support, MySQL, PostgreSQL or SQLite?
Drivers differ on foreign key ordering, SET FOREIGN_KEY_CHECKS, schema-qualified names and view handling, so coverage matters. SQLite is the default test driver in most Laravel projects and is often untested upstream, so verify it explicitly if you rely on it. Look for a documented support matrix or run your own pilot against each driver you use.
How does custom-fresh interact with the --seed option of migrate:fresh?
The interaction depends on ordering: if preserved tables are restored before seeders run, restored data can be overwritten, and if seeders run twice you get double-seeding. Test the combination with a small dataset and inspect the resulting row counts. If the behaviour is undocumented, raise it with the maintainer before putting it in a shared team script.
Can I use custom-fresh with multiple database connections and schema-qualified table names?
Verify whether the exclusion list is global or per-connection, since a global list can behave unexpectedly in multi-tenant or multi-database setups. Schema-qualified names such as public.users may need special handling depending on the driver. Run a pilot on a secondary connection before depending on it.
Is ramadan/custom-fresh safe to use in production?
It is development and CI tooling, installed with require-dev, so it should never ship to production. The real risk is a typo in the exclusion list, which either drops data you meant to keep or keeps a table you meant to rebuild. Use it only against disposable local or CI databases, and keep backups even there.
How do I run custom-fresh in CI pipelines or a composer script?
Wire the package command into your Makefile or composer script in place of migrate:fresh, exactly where your existing database rebuild step runs. Add a test that asserts preserved tables still contain rows and that migrations applied cleanly to the rest. That test is the only thing that will catch a bad exclusion list, since the package itself cannot know your intent.
What are the alternatives to custom-fresh, and is it actively maintained?
Alternatives include plain migrate:fresh --seed with fast reference-data seeders, SQL schema dumps, or registering your own db:wipe or post-fresh restore hook. The package has roughly 61 stars, zero dependents and a single maintainer, so there is little ecosystem validation or peer review of the drop-list logic. Check the actual tag history and commit cadence before relying on it long term, and treat the reported last-release date as a data-quality flag to confirm.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections