PHPackages                             mr-wolf-gb/faker-tunisia - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mr-wolf-gb/faker-tunisia

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mr-wolf-gb/faker-tunisia
========================

Tunisia Faker provider for Laravel

v1.1.0(1y ago)012MITPHPPHP ^8.1

Since May 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mr-wolf-gb/faker-tunisia)[ Packagist](https://packagist.org/packages/mr-wolf-gb/faker-tunisia)[ Docs](https://github.com/mr-wolf-gb/faker-tunisia)[ RSS](/packages/mr-wolf-gb-faker-tunisia/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Tunisia Faker Provider (Multi-Locale)
=====================================

[](#tunisia-faker-provider-multi-locale)

A custom Faker provider for generating Tunisian data in multiple locales (fr\_TN, en\_TN, ar\_TN) for Laravel.

Overview
--------

[](#overview)

This package provides a custom Faker provider for generating realistic Tunisian data in three locales:

- **fr\_TN**: French transliteration (Arabic data using the French alphabet)
- **en\_TN**: English format (Same names as fr\_TN but with English address formats)
- **ar\_TN**: Arabic script (Native Arabic script for all data)

The provider includes generators for:

- Person names (male and female first names, last names)
- Addresses (streets, cities, postal codes, governorates)
- Phone numbers (mobile and landline)
- Company names and details

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mr-wolf-gb/faker-tunisia
```

Usage
-----

[](#usage)

### Basic Usage with Specific Locale

[](#basic-usage-with-specific-locale)

```
// Create a Faker generator with specific locale
$faker = \FakerTunisia\TunisiaFakerFactory::create('fr_TN'); // French transliteration
// OR
$faker = \FakerTunisia\TunisiaFakerFactory::create('en_TN'); // English format
// OR
$faker = \FakerTunisia\TunisiaFakerFactory::create('ar_TN'); // Arabic script

// Generate data in the selected locale
$name = $faker->name;
$address = $faker->address;
$phone = $faker->phoneNumber;
$company = $faker->company;
```

### Mixing Locales

[](#mixing-locales)

One of the key features of this package is the ability to mix locales for different components:

```
// Start with a base locale
$faker = \FakerTunisia\TunisiaFakerFactory::create('fr_TN');

// Set specific locales for different components
$faker->setLocale('ar_TN', 'names');      // Use Arabic script for names
$faker->setLocale('en_TN', 'addresses');  // Use English format for addresses

// Generate mixed locale data
$name = $faker->name;           // Arabic script
$address = $faker->address;     // English format
$phone = $faker->phoneNumber;   // French format (default)
$company = $faker->company;     // French format (default)
```

Available components for mixing:

- `names`: Person names
- `addresses`: Addresses and locations
- `phones`: Phone numbers
- `companies`: Company names and details

### Available Formatters

[](#available-formatters)

#### Person Data

[](#person-data)

- `firstNameMale()` - Generate a male first name
- `firstNameFemale()` - Generate a female first name
- `lastName()` - Generate a last name
- `name($gender = null)` - Generate a full name

#### Address Data

[](#address-data)

- `streetName()` - Generate a street name
- `buildingNumber()` - Generate a building number
- `postcode()` - Generate a postal code (4 digits)
- `city()` - Generate a city name
- `governorate()` - Generate a governorate name
- `address()` - Generate a complete address

#### Phone Data

[](#phone-data)

- `mobileNumber()` - Generate a mobile phone number
- `landlineNumber()` - Generate a landline phone number
- `phoneNumber()` - Generate either a mobile or landline number

#### Company Data

[](#company-data)

- `company()` - Generate a company name
- `companySuffix()` - Generate a company suffix
- `companyPrefix()` - Generate a company prefix
- `companyIndustry()` - Generate a company industry

Laravel Integration
-------------------

[](#laravel-integration)

The package automatically registers with Laravel through its service provider. Once installed, you can use it in your Laravel application:

```
// In a Laravel controller or service
public function example()
{
    // Default locale (fr_TN)
    $faker = app('Faker');

    // Or specify a locale
    $faker = \FakerTunisia\TunisiaFakerFactory::create('ar_TN');

    // Mix locales if needed
    $faker->setLocale('en_TN', 'addresses');

    return [
        'name' => $faker->name,
        'address' => $faker->address,
        'phone' => $faker->phoneNumber,
        'company' => $faker->company,
    ];
}
```

```
// In Factory
class UserFactory extends Factory
{
    public function definition(): array
    {
        // Using factory
        $faker = \FakerTunisia\TunisiaFakerFactory::create('ar_TN');
        // Or add as provider
        $this->faker->addProvider(new \FakerTunisia\FrTunisiaProvider($this->faker));
        // $this->faker->addProvider(new \FakerTunisia\EnTunisiaProvider($this->faker));
        // $this->faker->addProvider(new \FakerTunisia\ArTunisiaProvider($this->faker));

        return [
            'name' => $faker->name,
            'address' => $faker->address,
            'phone' => $faker->phoneNumber,
            'company' => $faker->company,
        ];
    }
}
```

You can also set the default locale in your Laravel configuration:

```
// config/app.php
'faker_locale' => 'ar_TN',
```

Examples
--------

[](#examples)

### French Locale (fr\_TN)

[](#french-locale-fr_tn)

```
Male Name: Marouen Bahloul
Female Name: Syrine Marzougui
Address: Place Ibn Khaldoun 537, 6589 Monastir, Tunisie
Phone: +216 54 01 03 02
Company: Groupe de Bizerte SA

```

### English Locale (en\_TN)

[](#english-locale-en_tn)

```
Male Name: Nizar Mathlouthi
Female Name: Asma Ben Ali
Address: 454 Paris Boulevard, Zarzis, 1242, Tunisia
Phone: +216 78 03 01 02
Company: Hammami & Makhlouf Inc.

```

### Arabic Locale (ar\_TN)

[](#arabic-locale-ar_tn)

```
Male Name: مهدي ساسي
Female Name: غفران ماهر
Address: نهج الياسمين 787, الكاف, تونس
Phone: +216 21 01 02 03
Company: قربة التكنولوجيا ش.خ

```

### Mixed Locales

[](#mixed-locales)

```
Name (ar_TN): غيث طرابلسي
Address (en_TN): 922 Rue de la République, Bizerte, 6845, Tunisia
Phone (fr_TN): +216 73 02 01 03
Company (fr_TN): Transport de Tunisie SCS

```

License
-------

[](#license)

MIT

Credits
-------

[](#credits)

- Contributors: [Manus AI Agent](https://manus.im/)
- Research and data collection: Based on authentic Tunisian sources

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance46

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

412d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15419351feb134ab8ee8e00c4bab3be9f71f32c171a747c9ed6c2ada4d04d772?d=identicon)[gaiththewolf](/maintainers/gaiththewolf)

---

Top Contributors

[![mr-wolf-gb](https://avatars.githubusercontent.com/u/4011175?v=4)](https://github.com/mr-wolf-gb "mr-wolf-gb (5 commits)")

---

Tags

fakerfaker-generatorlaravellocalphptunisialaravelfakertunisiafaker-tunisiafaker-provider

### Embed Badge

![Health badge](/badges/mr-wolf-gb-faker-tunisia/health.svg)

```
[![Health](https://phpackages.com/badges/mr-wolf-gb-faker-tunisia/health.svg)](https://phpackages.com/packages/mr-wolf-gb-faker-tunisia)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
