tsterker/laravel-flextable

There is no license information available for the latest version (0.1.0) of this package.

Dynamically migrate and seed databases

0.1.0 2019-09-26 01:25 UTC

This package is auto-updated.

Last update: 2022-06-26 21:55:07 UTC


README

use Tsterker\Flextable\Manager;

$manager = new Manager($optionalConnection = 'custom');

$connection = $manager->getConnection();

$manager->migrate('/absolute/path/to/migrations');

$manager->seed(\Acme\DatabaseSeeder::class, $alternativeFactories = '/absolute/path/to/factories');

In case your Models have an explicit $connection property set:

A). Specify the connection name during new Manager('custom-connection)(⚠️ it will be replaced in the configuration!)

B). Use the IsFlextable trait on a base model that all relevant models inherit from.

use Tsterker\Flextable\IsFlextable;
use Tsterker\Flextable\Manager;

class BaseModel extends \Illuminate\Eloquent\Model
{
    use IsFlextable;

    protected $connection = 'custom-connection';
}