user image

Yasen Sayed
Published in : 2022-03-06

How can I use arabic words, paragraphs in the faker?

Laravel

I'd like to add Arabic words, paragraphs in the dummy data faker generator in the Laravel project for example see below:

public function definition(): array
    {
        return [
            'name_en' => $this->faker->unique()->name,
            'name_ar' => $this->faker->unique()->name, // It should be in Arabic
            'synonyms_en' => $this->faker->paragraph,
            'synonyms_ar' => $this->faker->paragraph,// It should be in Arabic
        ];
    }  

Please, anyone can help me to do this?

Comments

nico Date : 2022-03-07

Best answers

4

Best answers

4

Hello Yasen did you try to use 

 

$faker = Faker\Factory::create('ar_AA');



But Here you can find all the locales

https://faker.readthedocs.io/en/master/locales

You have to choose the local you need depending on the country as arabic is spoken in many places.


It should help, kind regards

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

tymon/jwt-auth 0.5.12 requires illuminate/support ~5.0
Publish date: 2022-02-18 | Comments: 2
How can i pass data from blade template to vue component?
Publish date: 2022-02-11 | Comments: 1
[SOLVED] No application encryption key has been specified.
Publish date: 2021-05-17 | Comments: 2
laravel installation error with composer install
Publish date: 2022-02-23 | Comments: 2
Method Illuminate\Auth\RequestGuard::attempt does not exist.
Publish date: 2022-02-18 | Comments: 2
How I can exclude private property from var_dump or object?
Publish date: 2022-02-22 | Comments: 2