PHP code example of mdantas / phinx-wrapper

1. Go to this page and download the library: Download mdantas/phinx-wrapper 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/ */

    

mdantas / phinx-wrapper example snippets


composer nerate env file, this not overwrite you env file.
vendor/bin/phinxwrap init_env

//In your app.php
//Config read from env or inject any place you need.
$config = \mdantas\PhinxWrap\PhinxConfiguration::envToConfigInterface(__DIR__.'/../')

$application = new \mdantas\PhinxWrap\ConsoleApplication(
        $config
);

public function __construct(\Phinx\Config\ConfigInterface $config)
{
    $this->addCommands([
        new Create($config),
        new Status($config),
        new Migrate($config),
        new Rollback($config),
        new SeedCreate($config),
        new SeedRun($config),
        new Test($config),
    ]);
}