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

//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

How to check Laravel version?
Publish date: 2022-04-07 | Comments: 2
[solved] Nginx 413 Request Entity Too Large - Laravel
Publish date: 2022-02-01 | Comments: 7
Get user location (city - country) from his IP address
Publish date: 2022-03-02 | Comments: 2