Custom Fresh is a Laravel package that adds a `fresh:custom` Artisan command as an alternative to `migrate:fresh`. Instead of dropping every table, it lets you specify which tables to preserve using comma-separated names or glob patterns (e.g., `subscription_*`). It includes a `--explain` flag for dry-run previews, `--database` for targeting specific connections, a publishable config file for setting persistent defaults, and three lifecycle events (`RefreshingDatabase`, `TablesDropped`, `DatabaseRefreshed`) for hooking into the refresh process. Requires PHP 8.2+ and supports Laravel 10–13.
Table of contents
# Choosing Which Tables Survive# Glob Patterns for Grouped Tables# Previewing Before You Commit# Configuration and Events# Installation595.2K Impressions14 Comments