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: 2024-03-27 01:33:20 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)(:warning: 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';
}