26 lines
524 B
PHP
26 lines
524 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Faker\ProductNameProvider;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Faker\Factory;
|
|
use Faker\Generator;
|
|
|
|
class FakerServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->app->singleton(Generator::class, function () {
|
|
$faker = Factory::create();
|
|
$faker->addProvider(new ProductNameProvider($faker));
|
|
return $faker;
|
|
});
|
|
}
|
|
}
|