/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->singleton(Factory::class, function ($app) {
         $faker = Faker::create();
         $analogueManager = $app->make('analogue');
         return Factory::construct($faker, database_path('factories'), $analogueManager);
     });
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $this->app['config']->set('database.default', 'sqlite');
     $this->app['config']->set('database.connections.sqlite.database', ':memory:');
     $this->app->singleton(Factory::class, function ($app) {
         $faker = Faker::create();
         $analogueManager = $app->make('analogue');
         return Factory::construct($faker, __DIR__ . '/factories', $analogueManager);
     });
     $this->analogue = $this->app->make('analogue');
     $this->analogue->setStrictMode(true);
     $this->migrateDatabase();
 }