Skip to content

Commit

Permalink
Merge pull request #64 from shaffe-fr/fix/faker-laravel
Browse files Browse the repository at this point in the history
Fix $faker->unique() and leverage Laravel's Faker singleton & config
  • Loading branch information
christophrumpel committed Nov 6, 2020
2 parents 9c61fea + 59d3b75 commit 1b927ee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/BaseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Christophrumpel\LaravelFactoriesReloaded;

use Faker\Factory as FakerFactory;
use Faker\Generator;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
Expand Down Expand Up @@ -30,7 +29,7 @@ public function __construct(Generator $faker)
/** @return static */
public static function new(): self
{
$faker = FakerFactory::create(config('app.faker_locale', 'en_US'));
$faker = app(Generator::class);

return new static($faker);
}
Expand Down

0 comments on commit 1b927ee

Please sign in to comment.