1. Go to this page and download the library: Download titipat/faker-php-thai 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/ */
// Your service provider, e.g. App\Providers\AppServiceProvider
use Faker\Generator;
public function boot(): void
{
$this->app->extend(Generator::class, function (Generator $faker) {
$faker->addProvider(new \Titipat\Faker\Provider\th_TH\Text($faker));
return $faker;
});
$this->app->bind(
Generator::class . ":" . config("app.faker_locale", "th_TH"),
Generator::class,
);
}