### Install development dependencies Source: https://github.com/amyavari/persian-faker-php/blob/main/CONTRIBUTING.md Run this command after cloning the repository to install necessary project dependencies. ```bash composer install ``` -------------------------------- ### Install persian-faker-php via Composer Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Use this command to add the package to your project's development dependencies. ```bash composer require --dev amyavari/persian-faker-php ``` -------------------------------- ### Generate Iranian Sheba Numbers in PHP Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/07-payment.md Examples of generating Sheba numbers with various configurations including prefix, separator, and bank-specific filtering. ```php echo $persianFaker->shebaNumber(); // 'IR690180000608266708481840', 'IR780140000153599122279494' echo $persianFaker->shebaNumber(withIR: false); // '690180000608266708481840', '780140000153599122279494' echo $persianFaker->shebaNumber(separator: '-'); // 'IR69-0180-0006-0826-6708-4818-40', 'IR78-0140-0001-5359-9122-2794-94' echo $persianFaker->shebaNumber(bank: 'mellat'); // 'IR260120000134988390291410', 'IR290120000343374321504241' echo $persianFaker->shebaNumber(withIR: false, separator: ' ', bank: 'mellat'); // '26 0120 0001 3498 8390 2914 10', '29 0120 0003 4337 4321 5042 41' // Bank name guide for Iran: 'melli' // Bank Melli Iran بانک ملی ایران 'sepah' // Bank Sepah بانک سپه 'tos_e_saderat' // Bank Tose'e Saderat Iran بانک توسعه صادرات ایران 'sanat_madan' // Bank Sanat va Madan بانک صنعت و معدن 'keshavarzi' // Bank Keshavarzi بانک کشاورزی 'maskan' // Bank Maskan بانک مسکن 'saderat' // Bank Saderat Iran بانک صادرات ایران 'post_bank' // Post Bank Iran پست بانک ایران 'mellat' // Bank Mellat بانک ملت 'tejarat' // Bank Tejarat بانک تجارت 'refah' // Bank Refah Kargaran بانک رفاه کارگران 'parsian' // Bank Parsian بانک پارسیان 'noor' // Bank Noor بانک نور 'pasargad' // Bank Pasargad بانک پاسارگاد 'melal' // Bank Melal بانک ملل 'ghavamin' // Bank Ghavamin بانک قوامین 'mehr_iran' // Bank Mehr Iran بانک مهر ایران 'karafarin' // Bank Karafarin بانک کارآفرین 'gardeshgari' // Bank Gardeshgari بانک گردشگری 'saman' // Bank Saman بانک سامان 'sina' // Bank Sina بانک سینا 'sarmaye' // Bank Sarmaye بانک سرمایه 'shahr' // Bank Shahr بانک شهر 'dey' // Bank Dey بانک دی 'eghtesad_novin' // Bank Eghtesad Novin بانک اقتصاد نوین 'ansar' // Bank Ansar بانک انصار 'iran_zamin' // Bank Iran Zamin بانک ایران زمین 'taavon' // Bank Taavon بانک توسعه تعاون ایران ``` -------------------------------- ### Run project tests Source: https://github.com/amyavari/persian-faker-php/blob/main/CONTRIBUTING.md Execute the full test suite to verify changes. ```bash composer test ``` -------------------------------- ### Initialize Persian Faker via Global Helper Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Use the global helper function for a more concise way to retrieve a Persian Faker instance. ```php $persianFaker = persian_faker(); ``` -------------------------------- ### Run unit tests Source: https://github.com/amyavari/persian-faker-php/blob/main/CONTRIBUTING.md Execute only the unit test suite. ```bash composer test:unit ``` -------------------------------- ### Initialize Persian Faker via Factory Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Create a new instance of the Persian Faker generator using the Factory class. ```php $persianFaker = \AliYavari\PersianFaker\Factory::create(); ``` -------------------------------- ### Check types Source: https://github.com/amyavari/persian-faker-php/blob/main/CONTRIBUTING.md Run static type analysis on the codebase. ```bash composer test:types ``` -------------------------------- ### Lint project code Source: https://github.com/amyavari/persian-faker-php/blob/main/CONTRIBUTING.md Execute this command to ensure the code adheres to the project's coding style. ```bash composer lint ``` -------------------------------- ### Generate random slugs Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/09-internet.md Demonstrates generating slugs with default settings, custom word counts, and fixed word counts. ```php echo $persianFaker->slug(); // 'نگاه-تصویر-برق-اتوبوس', 'کلاس-صادق-کاغذ-انگور-ساز-روز' echo $persianFaker->slug(nbWords: 4); // 'خیانت-شفق-سکوت-گیاه-آشپزخانه', 'دکتر-سبزی-مادیات' echo $persianFaker->slug(nbWords: 4, variableNbWords: false); // 'نگاه-تصویر-برق-اتوبوس' ,'خیانت-شفق-سکوت-گیاه' ``` -------------------------------- ### $persianFaker->company() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/05-company.md Generates a random company name. ```APIDOC ## $persianFaker->company() ### Description Generates a random company name. ### Usage ```php echo $persianFaker->company(); // 'گروه نگاه', 'آینده سازان راه امید' ``` ``` -------------------------------- ### Generate a state name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Returns a random Iranian province name. ```php echo $persianFaker->state(); // 'یزد' , 'کردستان' , 'سیستان و بلوچستان' ``` -------------------------------- ### state() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Generates a random Iranian state (province) name. ```APIDOC ## state() ### Description Generates a random state name (province in Iran). ### Signature `$persianFaker->state()` ### Returns - **string** - A random state name (e.g., 'یزد') ``` -------------------------------- ### Generate a city name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Returns a random Iranian city name. ```php echo $persianFaker->city(); // 'یزد' , 'سقز' , 'زاهدان' ``` -------------------------------- ### bank() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/07-payment.md Generates a random bank name in Iran. ```APIDOC ## bank() ### Description Generates a random bank name in Iran. ### Method `$persianFaker->bank()` ``` -------------------------------- ### Color Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian color names. ```APIDOC ## Color Methods ### Methods - safeColorName() - colorName() ``` -------------------------------- ### Generate Color Names Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating safe and standard color names in Persian. ```php safeColorName() // 'سیاه', 'آبی' colorName() // 'سبز زمردی', 'زغالی', 'زرد' ``` -------------------------------- ### $persianFaker->catchphrase() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/05-company.md Generates a random company catchphrase. ```APIDOC ## $persianFaker->catchphrase() ### Description Generates a random company catchphrase. ### Usage ```php echo $persianFaker->catchphrase(); // 'پیشرو در خدمات طراحی وب', 'یک قدم تا دنیای دیجیتال' ``` ``` -------------------------------- ### Generate State Phone Prefix Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/04-phone.md Returns a random state phone prefix for Iran. This method is unique to this library and not present in the original fakerphp/faker. ```php echo $persianFaker->statePhonePrefix(); // '035', '021', '013' ``` -------------------------------- ### address() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Generates a full random Iranian address. ```APIDOC ## address() ### Description Generates a random address in Iran including: street name, alley name and building number. ### Signature `$persianFaker->address()` ### Returns - **string** - A full random address string. ``` -------------------------------- ### Internet Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating internet-related data like slugs. ```APIDOC ## Internet Methods ### Methods - slug($nbWords = 6, $variableNbWords = true|false) ``` -------------------------------- ### Payment Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian bank and payment-related data. ```APIDOC ## Payment Methods ### Methods - bank() - cardNumber($separator = '', $bank = null) - shebaNumber($withIR = true|false, $separator = '', $bank = null) ``` -------------------------------- ### statePhonePrefix() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/04-phone.md Generates a random state phone prefix in Iran. ```APIDOC ## statePhonePrefix() ### Description Generates a random state phone prefix in Iran. ### Method `$persianFaker->statePhonePrefix()` ### Returns - **string** - A random state phone prefix (e.g., '035', '021'). ``` -------------------------------- ### Generate a random company name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/05-company.md Returns a random company name string. ```php echo $persianFaker->company(); // 'گروه نگاه', 'آینده سازان راه امید' ``` -------------------------------- ### Generate a full address Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Returns a complete address string including street, alley, and building number. ```php echo $persianFaker->streetName(); // 'بلوار خلیج فارس، خیابان لاله زار، خیابان پیروزی، کوچه چشمه نور، پلاک 425' ``` -------------------------------- ### $persianFaker->slug() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/09-internet.md Generates a random slug consisting of Persian words separated by hyphens. ```APIDOC ## Method: slug($nbWords = 6, $variableNbWords = true) ### Description Generates a random slug. The number of words can be specified, and the length can be set to vary or remain fixed. ### Parameters - **$nbWords** (int) - Optional - The number of words in the slug (default: 6). - **$variableNbWords** (bool) - Optional - Whether to allow the word count to vary slightly (default: true). Set to false for a strict word count. ### Usage Example ```php // Default usage echo $persianFaker->slug(); // With specific word count echo $persianFaker->slug(nbWords: 4); // With fixed word count echo $persianFaker->slug(nbWords: 4, variableNbWords: false); ``` ``` -------------------------------- ### city() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Generates a random Iranian city name. ```APIDOC ## city() ### Description Generates a random city name in Iran. ### Signature `$persianFaker->city()` ### Returns - **string** - A random city name (e.g., 'سقز') ``` -------------------------------- ### Generate Address Data Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian address components and postcodes. ```php secondaryAddress() // 'طبقه 2' state() // 'یزد' city() // 'یزد' streetName() // 'پاسداران شمالی' address() // 'خیابان کارگر، کوچه گلستان، پلاک 35 // Modified: accept optional argument postcode($withSeparator = false|true) // '1234567890' , '12345-67890' ``` -------------------------------- ### Address Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian address-related data. ```APIDOC ## Address Methods ### Methods - secondaryAddress() - state() - city() - streetName() - address() - postcode($withSeparator = false|true) ``` -------------------------------- ### Generate Company Information Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating company names, catchphrases, and job titles. ```php company() // 'گروه نگاه' catchphrase() // 'یک قدم تا دنیای دیجیتال' jobTitle() // 'برنامه نویس PHP', 'مدیر محصول' ``` -------------------------------- ### colorName() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/08-color.md Generates a random color name. ```APIDOC ## Method: colorName() ### Description Generates a random color name. ### Usage ```php echo $persianFaker->colorName(); ``` ``` -------------------------------- ### Company Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian company-related data. ```APIDOC ## Company Methods ### Methods - company() - catchphrase() - jobTitle() ``` -------------------------------- ### Generate Person Details Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating names, titles, and national codes. ```php title($gender = null|'male'|'female') // 'آقای' titleMale() // 'آقای' titleFemale() // 'خانم' name($gender = null|'male'|'female') // 'علی محمد یاوری' firstName($gender = null|'male'|'female') // 'علی محمد' firstNameMale() // 'علی محمد' firstNameFemale() // 'نیوشا' lastName() // 'یاوری' // New method nationalCode($state = null) // '0087199084', '1127905589' ``` -------------------------------- ### Generate a street name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Returns a random Iranian street name. ```php echo $persianFaker->streetName(); // 'شهر زیبا' , 'بلوار آسمان' , 'شهرک امید' ``` -------------------------------- ### paragraph() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a random paragraph with configurable sentence count. ```APIDOC ## paragraph() ### Description Generates a random paragraph. The number of sentences in the paragraph can be specified using the `$nbSentences` parameter (default: 3). To enforce a strict sentence count, set the `$variableNbSentences` parameter to false. ### Parameters - **nbSentences** (int) - Optional - Number of sentences in the paragraph (default: 3) - **variableNbSentences** (bool) - Optional - Whether to allow the sentence count to vary (default: true) ``` -------------------------------- ### Generate Internet Slugs Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Method for generating URL-friendly slugs. ```php slug($nbWords = 6, $variableNbWords = true|false) // 'نویس-اتوبوس-برنامه-دار', 'دیجیتال-دنیا-و-بی-یخ' ``` -------------------------------- ### $persianFaker->jobTitle() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/05-company.md Generates a random job title. ```APIDOC ## $persianFaker->jobTitle() ### Description Generates a random job title. ### Usage ```php echo $persianFaker->jobTitle(); // 'برنامه نویس PHP', 'مدیر محصول', 'کارشناس تولید محتوا' ``` ``` -------------------------------- ### sentence() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a random sentence with configurable word count. ```APIDOC ## sentence() ### Description Generates a random sentence. The number of words in the sentence can be specified using the `$nbWords` parameter (default: 6). To enforce a strict word count, set the `$variableNbWords` parameter to false. ### Parameters - **nbWords** (int) - Optional - Number of words in the sentence (default: 6) - **variableNbWords** (bool) - Optional - Whether to allow the word count to vary (default: true) ``` -------------------------------- ### titleMale() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random title for a male. ```APIDOC ## titleMale() ### Description Generates a random title for male. Equals to title('male'). ``` -------------------------------- ### Generate a random word Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Returns a single random Persian word. ```php echo $persianFaker->word(); // 'آتش', 'خاکستری', 'تا', 'و' ``` -------------------------------- ### sentences() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a random array of sentences or a string of sentences. ```APIDOC ## sentences() ### Description Generates a random array of sentences. The number of sentences returned can be specified using the `$nb` parameter (default: 3). Optionally, if `$asText` is set to true, a string of sentences will be returned instead. ### Parameters - **nb** (int) - Optional - Number of sentences to generate (default: 3) - **asText** (bool) - Optional - If true, returns a string instead of an array (default: false) ``` -------------------------------- ### word() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a single random Persian word. ```APIDOC ## word() ### Description Generates a random Persian word. ### Signature `word(): string` ``` -------------------------------- ### Generate a random job title Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/05-company.md Returns a random job title string. ```php echo $persianFaker->jobTitle(); // 'برنامه نویس PHP', 'مدیر محصول', 'کارشناس تولید محتوا' ``` -------------------------------- ### text() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a random text block with a maximum character limit. ```APIDOC ## text() ### Description Generates a random text. The maximum number of characters for the returned text can be specified using the `$maxNbChars` parameter (default: 200). ### Parameters - **maxNbChars** (int) - Optional - Maximum number of characters (default: 200) ``` -------------------------------- ### Text Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian text, words, sentences, and paragraphs. ```APIDOC ## Text Methods ### Methods - word() - words($nb = 3, $asText = false|true) - sentence($nbWords = 6, $variableNbWords = true|false) - sentences($nb = 3, $asText = false|true) - paragraph($nbSentences = 3, $variableNbSentences = true|false) - paragraphs($nb = 3, $asText = false|true) - text($maxNbChars = 200) ``` -------------------------------- ### streetName() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Generates a random Iranian street name. ```APIDOC ## streetName() ### Description Generates a random street name in Iran. ### Signature `$persianFaker->streetName()` ### Returns - **string** - A random street name (e.g., 'بلوار آسمان') ``` -------------------------------- ### Person Details Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian person-related data such as names, titles, and national codes. ```APIDOC ## Person Methods ### Methods - title($gender = null|'male'|'female') - titleMale() - titleFemale() - name($gender = null|'male'|'female') - firstName($gender = null|'male'|'female') - firstNameMale() - firstNameFemale() - lastName() - nationalCode($state = null) ``` -------------------------------- ### Generate Persian Titles Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random title, with optional gender filtering for male or female titles. ```php echo $persianFaker->title(); // 'آقای' , 'خانم' echo $persianFaker->title(gender: 'male'); // 'آقای' echo $persianFaker->title(gender: 'female'); // 'خانم' ``` -------------------------------- ### Generate Payment Details Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating bank names, card numbers, and Sheba numbers. ```php // New methods bank() // 'ملت', 'مهر ایران' cardNumber($separator = '', $bank = null) // '6273 8157 2593 3210', '5894639748556308' shebaNumber($withIR = true|false, $separator = '', $bank = null) // 'IR72-0540-0008-5961-5112-7527-92' ``` -------------------------------- ### Phone Methods Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating Persian phone and cell phone numbers. ```APIDOC ## Phone Methods ### Methods - phoneNumber($separator = '', $state = null) - statePhonePrefix() - cellPhone($separator = '', $provider = null) ``` -------------------------------- ### Generate a random company catchphrase Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/05-company.md Returns a random company catchphrase string. ```php echo $persianFaker->catchphrase(); // 'پیشرو در خدمات طراحی وب', 'یک قدم تا دنیای دیجیتال' ``` -------------------------------- ### Generate random bank name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/07-payment.md Returns a random bank name from the list of Iranian banks. ```php echo $persianFaker->bank(); // 'قرض الحسنه مهر ایران', 'گردشگری', 'ملت', 'ملی ایران', ``` -------------------------------- ### Generate First Name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random first name, with optional gender filtering. ```php echo $persianFaker->firstName(); // 'علی محمد', 'عاطفه' echo $persianFaker->firstName(gender: 'male'); // 'علی محمد' echo $persianFaker->firstName(gender: 'female'); // 'عاطفه' ``` -------------------------------- ### firstNameMale() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random first name for a male. ```APIDOC ## firstNameMale() ### Description Generates a random first name for male. Equals to firstName('male'). ``` -------------------------------- ### Generate a random color name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/08-color.md Returns a random color name from a comprehensive list of available colors. ```php echo $persianFaker->colorName(); // 'سیاه', 'آبی', 'زرد', 'سبز زمردی', 'زغالی' ``` -------------------------------- ### Generate Phone Numbers Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating phone numbers, prefixes, and cell phone numbers. ```php // Modified: accept optional arguments phoneNumber($separator = '', $state = null) // '03512345678' // New methods statePhonePrefix() // '035' cellPhone($separator = '', $provider = null) // '09121234567' ``` -------------------------------- ### paragraphs() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a random array of paragraphs or a string of paragraphs. ```APIDOC ## paragraphs() ### Description Generates a random array of paragraphs. The number of paragraphs returned can be specified using the `$nb` parameter (default: 3). Optionally, if `$asText` is set to true, a string of paragraphs will be returned instead. ### Parameters - **nb** (int) - Optional - Number of paragraphs to generate (default: 3) - **asText** (bool) - Optional - If true, returns a string instead of an array (default: false) ``` -------------------------------- ### name(string $gender = null) Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random full name (first name and last name). ```APIDOC ## name(string $gender = null) ### Description Generates a random full name (first name and last name). Optionally it's possible to specify the $gender parameter to limit only 'male' names or 'female' names. ### Parameters - **gender** (string) - Optional - The gender to filter by ('male' or 'female'). ``` -------------------------------- ### words() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Generates a random array of words or a string of words. ```APIDOC ## words() ### Description Generates a random array of words. The number of words returned can be specified using the `$nb` parameter (default: 3). Optionally, if `$asText` is set to true, a string of words will be returned instead. ### Parameters - **nb** (int) - Optional - Number of words to generate (default: 3) - **asText** (bool) - Optional - If true, returns a string instead of an array (default: false) ``` -------------------------------- ### lastName() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random last name. ```APIDOC ## lastName() ### Description Generates a random last name. ``` -------------------------------- ### Generate Last Name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random last name. ```php echo $persianFaker->lastName(); // 'یاوری', 'ایزدی' ``` -------------------------------- ### firstName(string $gender = null) Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random first name. ```APIDOC ## firstName(string $gender = null) ### Description Generates a random first name. Optionally it's possible to specify the $gender parameter to limit only 'male' names or 'female' names. ### Parameters - **gender** (string) - Optional - The gender to filter by ('male' or 'female'). ``` -------------------------------- ### firstNameFemale() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random first name for a female. ```APIDOC ## firstNameFemale() ### Description Generates a random first name for female. Equals to firstName('female'). ``` -------------------------------- ### secondaryAddress() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Generates a random secondary address string. ```APIDOC ## secondaryAddress() ### Description Generates a random secondary address. ### Signature `$persianFaker->secondaryAddress()` ### Returns - **string** - A random secondary address (e.g., 'واحد 18') ``` -------------------------------- ### titleFemale() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random title for a female. ```APIDOC ## titleFemale() ### Description Generates a random title for female. Equals to title('female'). ``` -------------------------------- ### Generate Text Content Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/01_getting_started.md Methods for generating words, sentences, paragraphs, and full text blocks. ```php word() // 'آتش', 'خاکستری' words($nb = 3, $asText = false|true) // ['خاکستری', 'سریع' , 'دارچین'], 'خاکستری سریع دارچین' sentence($nbWords = 6, $variableNbWords = true|false) // '.نویس اتوبوس برنامه دار.', 'دیجیتال دنیا و بی یخ' sentences($nb = 3, $asText = false|true) // ['خاکستری سریع دارچین','.یخ در بهشت.'], 'خاکستری سریع دارچین. یخ در بهشت.' paragraph($nbSentences = 3, $variableNbSentences = true|false) // 'خاکستری سریع دارچین اما اینجا. یخ در بهشت بها. دیجیتال دنیا و بی یخ..' paragraphs($nb = 3, $asText = false|true) text($maxNbChars = 200) // 'ثانیه رنگ هفته ماه ملی پاییز انسان تنظیم تخم‌مرغ بخار نهاد صعود بیعت تند تفکر توانا پناهگاه برنامه سکه برگ' ``` -------------------------------- ### Generate Full Name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random full name, with optional gender filtering. ```php echo $persianFaker->name(); // 'علی محمد یاوری', 'عاطفه ایزدی' echo $persianFaker->name(gender: 'male'); // 'علی محمد یاوری' echo $persianFaker->name(gender: 'female'); // 'عاطفه ایزدی' ``` -------------------------------- ### postcode() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Generates a random valid Iranian postal code with optional formatting. ```APIDOC ## postcode() ### Description Generates a random valid postal code in Iran. ### Parameters - **withSeparator** (bool) - Optional - Set to true to format the postal code with a dash (-) separator. ### Signature `$persianFaker->postcode(bool $withSeparator = false)` ### Returns - **string** - A random postal code string. ``` -------------------------------- ### safeColorName() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/08-color.md Generates a random color name from a set of 16 primary color names. ```APIDOC ## Method: safeColorName() ### Description Generates a random color name from a set of 16 primary color names. ### Usage ```php echo $persianFaker->safeColorName(); ``` ``` -------------------------------- ### title(string $gender = null) Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random title. Optionally specify the gender parameter to limit results to 'male' or 'female'. ```APIDOC ## title(string $gender = null) ### Description Generates a random title. Optionally it's possible to specify the $gender parameter to limit only 'male' titles or 'female' titles. ### Parameters - **gender** (string) - Optional - The gender to filter by ('male' or 'female'). ``` -------------------------------- ### Generate random sentences Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Returns an array of random sentences, with optional count and string formatting. ```php echo $persianFaker->sentences(); // ['وزن انگور زیرا شب صبح کار.', 'جوان هنوز مدبر سکه که زعفران.', 'سیستم تنها نسیم نوشابه ادراک فضا ابر اهل.'] echo $persianFaker->sentences(nb: 2); // ['وزن انگور زیرا شب صبح کار.', 'جوان هنوز مدبر سکه که زعفران.'] echo $persianFaker->sentences(nb: 2, asText: true); // 'وزن انگور زیرا شب صبح کار. جوان هنوز مدبر سکه که زعفران.' ``` -------------------------------- ### Generate a secondary address Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Returns a random secondary address string such as a unit or floor number. ```php echo $persianFaker->secondaryAddress(); // 'واحد 18' , 'طبقه 3' , 'سوئیت 4' ``` -------------------------------- ### Generate Female First Name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random female first name. ```php echo $persianFaker->firstNameFemale(); // 'عاطفه' ``` -------------------------------- ### Generate random paragraphs Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Returns an array of random paragraphs, with optional count and string formatting. ```php echo $persianFaker->paragraphs(); // [ // 'زنجبیل میراث بزرگ کتابخانه. دامپروری لذت زنبور احسان فعالیت سکوت حسابگر. طاقت ثروت سبک ترانه عشق عشق کلاس. سلام قدرت چکیده ریتم.', // 'احسان خیابان آب سیستم سبک اما اجاق دشمنی. تاکید بهار مفید پول. تفکر دامپروری قهوه طبیعت اشاره پدر دقیقه.', // 'کاغذ قدرت آبی شعر زیان. خانه ذهن دانش نمایش رژیم حمام گلخانه. سمی تا ورزش مادیات.', // ] echo $persianFaker->paragraphs(nb: 4); // [ // 'زنجبیل میراث بزرگ کتابخانه. دامپروری لذت زنبور احسان فعالیت سکوت حسابگر. طاقت ثروت سبک ترانه عشق عشق کلاس. سلام قدرت چکیده ریتم.', // 'احسان خیابان آب سیستم سبک اما اجاق دشمنی. تاکید بهار مفید پول. تفکر دامپروری قهوه طبیعت اشاره پدر دقیقه.', // 'کاغذ قدرت آبی شعر زیان. خانه ذهن دانش نمایش رژیم حمام گلخانه. سمی تا ورزش مادیات.', // 'چاپ قهوه‌ای تولد و صرفه تفکر طرح اشاره. پرستار برج آبمیوه.', // ] echo $persianFaker->paragraphs(nb: 4, asText: true); // 'زنجبیل میراث بزرگ کتابخانه. دامپروری لذت زنبور احسان فعالیت سکوت حسابگر. طاقت ثروت سبک ترانه عشق عشق کلاس. سلام قدرت چکیده ریتم.\n // احسان خیابان آب سیستم سبک اما اجاق دشمنی. تاکید بهار مفید پول. تفکر دامپروری قهوه طبیعت اشاره پدر دقیقه.\n // کاغذ قدرت آبی شعر زیان. خانه ذهن دانش نمایش رژیم حمام گلخانه. سمی تا ورزش مادیات.\n // چاپ قهوه‌ای تولد و صرفه تفکر طرح اشاره. پرستار برج آبمیوه.' ``` -------------------------------- ### Generate a safe color name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/08-color.md Returns a random color name from a predefined set of 16 primary colors. ```php echo $persianFaker->safeColorName(); // 'سیاه', 'آبی', 'زرد' ``` -------------------------------- ### phoneNumber() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/04-phone.md Generates a random landline phone number in Iran with optional formatting and state filtering. ```APIDOC ## phoneNumber() ### Description Generates a random phone number in Iran. Supports custom separators and filtering by state. ### Method `$persianFaker->phoneNumber(string $separator = '', string $state = null)` ### Parameters - **separator** (string) - Optional - The character used to separate the prefix from the number. - **state** (string) - Optional - The specific state name to use for the prefix. ### Returns - **string** - A formatted Iranian phone number. ``` -------------------------------- ### Generate Iranian National Code Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random Iranian national code, optionally filtered by state. ```php echo $persianFaker->nationalCode(); // '0087199084', '1127905589' echo $persianFaker->nationalCode(state: 'yazd'); // '4424489752', '4434728431' ``` -------------------------------- ### Generate Female Title Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random female title. ```php echo $persianFaker->titleFemale(); // 'خانم' ``` -------------------------------- ### Generate random words Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Returns an array of random words, with optional count and string formatting. ```php echo $persianFaker->words(); // ['نگاه', 'تصویر', 'برق'] echo $persianFaker->words(nb: 4); // ['نگاه', 'تصویر', 'برق', 'اتوبوس'] echo $persianFaker->words(nb: 4, asText: true); // 'نگاه تصویر برق اتوبوس' ``` -------------------------------- ### Generate random bank card number Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/07-payment.md Generates a random Iranian bank card number with optional separator and bank filtering. ```php echo $persianFaker->cardNumber(); // '6395994370054358', '6395994370054358' echo $persianFaker->cardNumber(separator: '-'); // '6395-9943-7005-4358', '6395-9943-7005-4358' echo $persianFaker->cardNumber(bank: 'mellat'); // '6104336643590175', '6104337825440666' echo $persianFaker->cardNumber(separator: ' ', bank: 'mellat'); // '6104 3366 4359 0175', '6104 3378 2544 0666' // Bank name guide for Iran: 'melli' // Bank Melli Iran بانک ملی ایران 'sepah' // Bank Sepah بانک سپه 'tos_e_saderat' // Bank Tose'e Saderat Iran بانک توسعه صادرات ایران 'sanat_madan' // Bank Sanat va Madan بانک صنعت و معدن 'keshavarzi' // Bank Keshavarzi بانک کشاورزی 'maskan' // Bank Maskan بانک مسکن 'saderat' // Bank Saderat Iran بانک صادرات ایران 'post_bank' // Post Bank Iran پست بانک ایران 'mellat' // Bank Mellat بانک ملت 'tejarat' // Bank Tejarat بانک تجارت 'refah' // Bank Refah Kargaran بانک رفاه کارگران 'parsian' // Bank Parsian بانک پارسیان 'noor' // Bank Noor بانک نور 'pasargad' // Bank Pasargad بانک پاسارگاد 'melal' // Bank Melal بانک ملل 'ghavamin' // Bank Ghavamin بانک قوامین 'mehr_iran' // Bank Mehr Iran بانک مهر ایران 'karafarin' // Bank Karafarin بانک کارآفرین 'gardeshgari' // Bank Gardeshgari بانک گردشگری 'saman' // Bank Saman بانک سامان 'sina' // Bank Sina بانک سینا 'sarmaye' // Bank Sarmaye بانک سرمایه 'shahr' // Bank Shahr بانک شهر 'dey' // Bank Dey بانک دی 'eghtesad_novin' // Bank Eghtesad Novin بانک اقتصاد نوین 'ansar' // Bank Ansar بانک انصار 'iran_zamin' // Bank Iran Zamin بانک ایران زمین 'taavon' // Bank Taavon بانک توسعه تعاون ایران ``` -------------------------------- ### Generate a random sentence Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Returns a random sentence with configurable word count and strict length enforcement. ```php echo $persianFaker->sentence(); // 'نگاه تصویر برق اتوبوس', 'کلاس صادق کاغذ انگور ساز روز.' echo $persianFaker->sentence(nbWords: 4); // 'خیانت شفق سکوت گیاه آشپزخانه.', 'دکتر سبزی مادیات.' echo $persianFaker->sentence(nbWords: 4, variableNbWords: false); // 'نگاه تصویر برق اتوبوس' ,'خیانت شفق سکوت گیاه.' ``` -------------------------------- ### Generate Male Title Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random male title. ```php echo $persianFaker->titleMale(); // 'آقای' ``` -------------------------------- ### Generate Phone Numbers Source: https://github.com/amyavari/persian-faker-php/blob/main/README.md Methods for generating Persian phone and cell phone numbers with optional formatting. ```php // Modified: accept optional arguments phoneNumber($separator = '', $state = null) // '03512345678', '035-12345678' // New methods statePhonePrefix() // '035' cellPhone($separator = '', $provider = null) // '09121234567', '0912-123-4567' ``` -------------------------------- ### cardNumber() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/07-payment.md Generates a random bank card number in Iran with optional separator and bank filtering. ```APIDOC ## cardNumber() ### Description Generates a random bank card number in Iran. It accepts an optional separator and a specific bank identifier. ### Method `$persianFaker->cardNumber(string $separator = '', string $bank = null)` ### Parameters - **separator** (string) - Optional - The character used to separate every four digits. - **bank** (string) - Optional - The specific bank identifier to generate a card number for. ``` -------------------------------- ### Generate a random paragraph Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/06-text.md Returns a random paragraph with configurable sentence count and strict length enforcement. ```php echo $persianFaker->paragraph(); // 'وزن انگور زیرا شب صبح کار. جوان هنوز مدبر سکه که زعفران. سیستم تنها نسیم نوشابه ادراک فضا ابر اهل.' echo $persianFaker->paragraph(nbSentences: 4); // 'دست بازار اعتبار ارزش پل. هوش باد رادیو سبز دلبستگی. بدون کتاب زهره سیستم صندلی ماهیگیر. فکر چون تاج مهم خانه. نقاشی سایه چمن بیعت راهنما.' echo $persianFaker->paragraph(nbSentences: 4, variableNbSentences: false); // 'آرام آتش بیمارستان. زرد قدرت خیانت شکلات. احساس پس گرم داروخانه داور. خیابان اولویت برگ هدف عملکرد نور بدون فریاد.' ``` -------------------------------- ### Generate Male First Name Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random male first name. ```php echo $persianFaker->firstNameMale(); // 'علی محمد' ``` -------------------------------- ### nationalCode(string $state = null) Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/02-person.md Generates a random Iranian national code, optionally filtered by state. ```APIDOC ## nationalCode(string $state = null) ### Description Generates a random Iranian national code. It accepts $state, which allows generating national code for citizens of a specific state. ### Parameters - **state** (string) - Optional - The state name to generate a code for (e.g., 'tehran', 'yazd'). ``` -------------------------------- ### cellPhone() Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/04-phone.md Generates a random cell phone number in Iran with optional formatting and provider filtering. ```APIDOC ## cellPhone() ### Description Generates a random cell phone number in Iran. Supports custom separators and filtering by mobile provider. ### Method `$persianFaker->cellPhone(string $separator = '', string $provider = null)` ### Parameters - **separator** (string) - Optional - The character used to separate segments of the mobile number. - **provider** (string) - Optional - The specific mobile provider (e.g., 'mci', 'mtn', 'rightel', 'shatel'). ### Returns - **string** - A formatted Iranian cell phone number. ``` -------------------------------- ### Generate a postal code Source: https://github.com/amyavari/persian-faker-php/blob/main/docs/en/03-address.md Returns a random Iranian postal code, with an optional boolean argument to include a dash separator. ```php echo $persianFaker->postcode(); // '1234567890' echo $persianFaker->postcode(withSeparator: true); // '12345-67890' ```