Anvil
Anvil - The mobile companion for Laravel Forge. Available now. Download for iOS

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 errors
10 */
11 'use_transactions' => env('PATCHES_USE_TRANSACTIONS', false),
12 
13 /**
14 * Error handling
15 * Stop execution on first error, or continue running remaining patches
16 */
17 'stop_on_error' => env('PATCHES_STOP_ON_ERROR', true),
18 'log_errors' => env('PATCHES_LOG_ERRORS', true),
19 
20 /**
21 * Metadata tracking
22 * Track execution metrics like time, memory, user, and environment
23 */
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 settings
30 * Show patch descriptions in commands
31 */
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=true
10 
11# Metadata Tracking
12PATCHES_TRACK_METADATA=true
13PATCHES_TRACK_MEMORY=true
14PATCHES_TRACK_USER=true
15 
16# Display
17PATCHES_SHOW_DESCRIPTIONS=true

Customizing Table Name

If you need to use a custom table name:

1// config/laravel-patches.php
2'table_name' => 'custom_patches_table',

Then republish and run migrations to create the table with your custom name.