Skip to content

Commit

Permalink
Fix reliance on faker
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Keith committed Jun 10, 2019
1 parent 7ece10f commit 55deb65
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/MultitenancyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace RomegaDigital\Multitenancy;

use Illuminate\Database\Eloquent\Factory as EloquentFactory;
use Faker\Generator as FakerGenerator;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Gate;
Expand All @@ -27,8 +29,12 @@ public function boot(Filesystem $filesystem)
if ($this->app->runningInConsole()) {
$this->registerPublishing($filesystem);
}

$this->app->make('Illuminate\Database\Eloquent\Factory')->load(__DIR__.'/Factories');

$this->app->singleton(EloquentFactory::class, function ($app) {
return EloquentFactory::construct(
$app->make(FakerGenerator::class), __DIR__.'/Factories'
);
});

$this->registerCommands();
$this->registerModelBindings();
Expand Down

0 comments on commit 55deb65

Please sign in to comment.