Skip to content

tsterker/laravel-flextable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

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';
}

About

Dynamically migrate and seed databases

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages