PHP code example of aldoggutierrez / laravel-schema-manager

1. Go to this page and download the library: Download aldoggutierrez/laravel-schema-manager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aldoggutierrez / laravel-schema-manager example snippets


return [
    'default_source_schema' => env('SCHEMA_MANAGER_SOURCE', 'external'),
    'default_destination_schema' => env('SCHEMA_MANAGER_DESTINATION', 'public'),
    'connection' => env('SCHEMA_MANAGER_CONNECTION', null),
    'log_queries' => env('SCHEMA_MANAGER_LOG_QUERIES', false),
];

return [
    /*
     * Default source schema when moving tables
     */
    'default_source_schema' => env('SCHEMA_MANAGER_SOURCE', 'external'),

    /*
     * Default destination schema when moving tables
     */
    'default_destination_schema' => env('SCHEMA_MANAGER_DESTINATION', 'public'),

    /*
     * Database connection to use (leave null to use default)
     */
    'connection' => env('SCHEMA_MANAGER_CONNECTION', null),

    /*
     * Enable query logging during operations
     */
    'log_queries' => env('SCHEMA_MANAGER_LOG_QUERIES', false),
];

bash
php artisan vendor:publish --tag="schema-manager-config"
bash
# Dump the default pgsql connection (uses search_path, falls back to public)
php artisan schema:dump

# Specify a custom connection
php artisan schema:dump --database=tenant

# Dump specific schemas
php artisan schema:dump --schemas=billing,reports

# Write to a custom path
php artisan schema:dump --path=/tmp/schema.sql

# Prune existing migration files after dumping
php artisan schema:dump --prune