🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.
Configuration
You can publish the config file with:
1php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-config"
You can publish and run the migrations with:
1php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-migrations"2php artisan migrate
Configuration Options
The configuration file config/laravel-patches.php includes the following options:
1return [ 2 /** 3 * Table name for storing patch information 4 */ 5 'table_name' => env('PATCHES_TABLE_NAME', 'patches'), 6 7 /** 8 * Transaction settings 9 * Wrap patches in database transactions for automatic rollback on errors10 */11 'use_transactions' => env('PATCHES_USE_TRANSACTIONS', false),12 13 /**14 * Error handling15 * Stop execution on first error, or continue running remaining patches16 */17 'stop_on_error' => env('PATCHES_STOP_ON_ERROR', true),18 'log_errors' => env('PATCHES_LOG_ERRORS', true),19 20 /**21 * Metadata tracking22 * Track execution metrics like time, memory, user, and environment23 */24 'track_metadata' => env('PATCHES_TRACK_METADATA', true),25 'track_memory' => env('PATCHES_TRACK_MEMORY', true),26 'track_user' => env('PATCHES_TRACK_USER', true),27 28 /**29 * Display settings30 * Show patch descriptions in commands31 */32 'show_descriptions' => env('PATCHES_SHOW_DESCRIPTIONS', true),33];
Environment Variables
You can control these settings via your .env file:
1# Table Configuration 2PATCHES_TABLE_NAME=patches 3 4# Transaction Settings 5PATCHES_USE_TRANSACTIONS=false 6 7# Error Handling 8PATCHES_STOP_ON_ERROR=true 9PATCHES_LOG_ERRORS=true10 11# Metadata Tracking12PATCHES_TRACK_METADATA=true13PATCHES_TRACK_MEMORY=true14PATCHES_TRACK_USER=true15 16# Display17PATCHES_SHOW_DESCRIPTIONS=true
Customizing Table Name
If you need to use a custom table name:
1// config/laravel-patches.php2'table_name' => 'custom_patches_table',
Then republish and run migrations to create the table with your custom name.