PHP code example of webinvader / fakerphp-english-word-provider

1. Go to this page and download the library: Download webinvader/fakerphp-english-word-provider library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webinvader / fakerphp-english-word-provider example snippets




namespace App\Providers;

use Webinvader\Faker\Provider\EnglishWord;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        $this->app->bind('Faker\Generator:en_US', function ($app) {
            $faker = \Faker\Factory::create();
            $faker->addProvider(EnglishWord::class);
            return $faker;
        });
    }
}

    use Webinvader\Faker\Provider\EnglishWord;

    public function definition(): array
    {
        $this->faker->addProvider(EnglishWord::class);
    ...