Last active
September 28, 2019 11:55
-
-
Save grandmanitou/9302f081781425898a484af67c9597fc to your computer and use it in GitHub Desktop.
Extend Faker with Laravel 5.x and 6.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** composer require fzaninotto/company-name-generator */ | |
use App\Models\MyModel; | |
use Faker\Generator as Faker; | |
$factory->define(MyModel::class, function (Faker $faker) { | |
$faker->addProvider(new CompanyNameGenerator\FakerProvider($faker)); | |
return [ | |
'name' => $faker->companyName, // Magic Here | |
'description' => $faker->text, | |
'started_at' => now(), | |
'ended_at' => now(), | |
'created_at' => now(), | |
'updated_at' => now(), | |
]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment