PHP code example of talandis / lara-migrations

1. Go to this page and download the library: Download talandis/lara-migrations 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/ */

    

talandis / lara-migrations example snippets


[
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'sample_db',
    'username' => 'root',
    'password' => 'super_secret_pass',
    'charset' => 'utf8',
    'prefix' => '',
    'collation' => 'utf8_general_ci',
    'schema' => 'public'
]

$migrator->registerContainerItem( 'db-config', function ($c) {

    T,
        'database' =>  DB_NAME,
        'username' => DB_USERNAME,
        'password' => DB_PASSWORD,
        'charset' => 'utf8',
        'prefix' => '',
        'collation' => 'utf8_general_ci',
        'schema' => 'public'
    ];
} );

php artisan migrate

php artisan migrate --database=development