A Laravel faker library to generate typical Nigeria fake data ranging from name, address, phone number, LGAs and states for you. It supports Yoruba, Igbo, and Hausa ethnic groups with culturally authentic data.
kodegrenade/naija-faker-laravel is a Laravel package for a laravel faker library to generate typical nigeria fake data ranging from name, address, phone number, lgas and states for you. it supports yoruba, igbo, and hausa ethnic groups with culturally authentic data..
It currently has 4 GitHub stars and 8 downloads on Packagist (latest version v1.0.2).
Install it with composer require kodegrenade/naija-faker-laravel.
Discover more Laravel packages by kodegrenade
or browse all Laravel packages to compare alternatives.
Last updated
A comprehensive package that generates fake, culturally authentic Nigerian data — names, addresses, phone numbers, bank accounts, universities, companies, and much more. Supports three major ethnic groups: Yoruba, Igbo, and Hausa.
NB: Nigeria as a country has so many languages.
Yoruba,IgboandHausaare the only languages supported at the moment.
Install via composer
composer require kodegrenade/naija-faker-laravel
Add service provider to the config/app.php file
<?php
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
*/
'providers' => [
...
Kodegrenade\NaijaFaker\NaijaFakerServiceProvider::class,
];
...
Add alias to the config/app.php file
'aliases' => [
...
'NaijaFaker' => Kodegrenade\NaijaFaker\NaijaFaker::class,
];
...
NOTE All methods return associative arrays or strings.
Set a seed for reproducible output (useful for testing):
<?php
NaijaFaker::seed(12345);
$name1 = NaijaFaker::name(); // always the same
NaijaFaker::seed(null); // reset to random mode
Set default language, gender, or network:
<?php
NaijaFaker::config([
'language' => 'yoruba',
'gender' => 'male',
'network' => 'mtn',
]);
Generate fake person data.
<?php
NaijaFaker::person(string $language, string $gender);
$person = NaijaFaker::person('yoruba', 'male');
[
'title' => 'Engr.',
'firstName' => 'Akintunde',
'lastName' => 'Owoyele',
'fullName' => 'Akintunde Owoyele',
'email' => '[email protected]',
'phone' => '+2349093636382',
'address' => 'Plot 63, Ebubedike Uzoma Avenue, Awka',
]
Generate multiple fake people.
<?php
NaijaFaker::people(int $count = 10, string $language, string $gender);
Generate a fake name.
<?php
$name = NaijaFaker::name('hausa', 'male');
// => "Ahmed Maikudi"
Generate a fake Nigerian title.
<?php
$title = NaijaFaker::title('male');
// => "Chief"
Generate a fake email address.
<?php
$email = NaijaFaker::email('Temitope Ayotunde');
// => "[email protected]"
$email = NaijaFaker::email('Temitope Ayotunde', 'workplace.com');
// => "[email protected]"
Generate a fake Nigerian address.
<?php
$address = NaijaFaker::address();
// => "Plot 45, Oluwaseun Adedayo Street, Ibadan"
Generate a fake Nigerian phone number.
<?php
NaijaFaker::phoneNumber(string $network);
NOTE: Supported networks are
mtn,glo,9mobile&airtel
$phone = NaijaFaker::phoneNumber('mtn');
// => "+2347037653761"
<?php
$states = NaijaFaker::states(); // all 37 Nigerian states
$lgas = NaijaFaker::lgas(); // all 774 LGAs
$bvn = NaijaFaker::bvn();
// => "22345678901"
$nin = NaijaFaker::nin();
// => "12345678901"
$account = NaijaFaker::bankAccount();
// => ['bankName' => 'Access Bank', 'bankCode' => '044', 'accountNumber' => '1234567890']
$account = NaijaFaker::bankAccount('Zenith Bank');
// => ['bankName' => 'Zenith Bank', 'bankCode' => '057', 'accountNumber' => '0987654321']
Generate persons where name ethnicity, state, and LGA all match geographically.
$person = NaijaFaker::consistentPerson('yoruba', 'male');
[
'title' => 'Chief',
'firstName' => 'Adebayo',
'lastName' => 'Ogunlesi',
'fullName' => 'Adebayo Ogunlesi',
'email' => '[email protected]',
'phone' => '+2348031234567',
'address' => 'Plot 45, Oluwaseun Adedayo Street, Ibadan',
'state' => 'Oyo', // matches Yoruba region
'lga' => 'Ibadan North', // belongs to Oyo state
]
$people = NaijaFaker::consistentPeople(5, 'igbo', 'female');
$plate = NaijaFaker::licensePlate(); // => "KAN-234XY"
$plate = NaijaFaker::licensePlate('Lagos'); // => "LAG-567AB"
$company = NaijaFaker::company();
// => ['name' => 'Pan-African Technologies Ltd', 'rcNumber' => 'RC-456789', 'industry' => 'Technology']
$uni = NaijaFaker::university();
// => ['name' => 'University of Lagos', 'abbreviation' => 'UNILAG', 'state' => 'Lagos', 'type' => 'federal']
$edu = NaijaFaker::educationRecord('yoruba');
// => ['university' => 'University of Ibadan', 'abbreviation' => 'UI', 'degree' => 'B.Sc', 'course' => 'Computer Science', 'graduationYear' => 2019]
$work = NaijaFaker::workRecord();
// => ['company' => 'Global Finance Holdings', 'position' => 'Software Engineer', 'industry' => 'Technology', 'startYear' => 2020]
$vehicle = NaijaFaker::vehicleRecord('Lagos');
// => ['licensePlate' => 'LAG-234XY', 'make' => 'Toyota', 'model' => 'Corolla', 'year' => 2021, 'color' => 'Silver']
$dob = NaijaFaker::dateOfBirth();
// => ['date' => '1990-03-15', 'age' => 35]
$dob = NaijaFaker::dateOfBirth(['minAge' => 25, 'maxAge' => 40]);
$status = NaijaFaker::maritalStatus();
// => "Married"
$bg = NaijaFaker::bloodGroup(); // => "O+"
$gt = NaijaFaker::genotype(); // => "AA"
$salary = NaijaFaker::salary();
// => ['amount' => 450000, 'currency' => 'NGN', 'level' => 'mid', 'frequency' => 'monthly']
$salary = NaijaFaker::salary(['level' => 'senior']);
$kin = NaijaFaker::nextOfKin('yoruba', 'female');
// => ['fullName' => 'Folake Adeyemi', 'relationship' => 'Sister', 'phone' => '+234...', 'address' => '...']
Generate a complete identity with person, personal data, education, work, and vehicle all in one call:
$person = NaijaFaker::detailedPerson('yoruba', 'male');
[
// Person
'title' => 'Chief',
'firstName' => 'Adebayo',
'lastName' => 'Ogunlesi',
'fullName' => 'Adebayo Ogunlesi',
'email' => '[email protected]',
'phone' => '+2348031234567',
'address' => 'Plot 45, Oluwaseun Street, Ibadan',
'state' => 'Oyo',
'lga' => 'Ibadan North',
// Personal
'dateOfBirth' => ['date' => '1990-03-15', 'age' => 35],
'maritalStatus' => 'Married',
'bloodGroup' => 'O+',
'genotype' => 'AA',
'salary' => ['amount' => 450000, 'currency' => 'NGN', 'level' => 'mid', 'frequency' => 'monthly'],
'nextOfKin' => ['fullName' => 'Folake Adeyemi', 'relationship' => 'Spouse', 'phone' => '...', 'address' => '...'],
// Records
'education' => ['university' => 'University of Ibadan', 'abbreviation' => 'UI', 'degree' => 'B.Sc', 'course' => 'Computer Science', 'graduationYear' => 2019],
'work' => ['company' => 'Pan-African Solutions Ltd', 'position' => 'Software Engineer', 'industry' => 'Technology', 'startYear' => 2020],
'vehicle' => ['licensePlate' => 'OYO-234XY', 'make' => 'Toyota', 'model' => 'Corolla', 'year' => 2021, 'color' => 'Silver'],
]
$people = NaijaFaker::detailedPeople(5, 'igbo');
Export generated data as JSON or CSV:
$json = NaijaFaker::export('person', 10, 'json');
$csv = NaijaFaker::export('detailedPerson', 5, 'csv');
$csv = NaijaFaker::export('consistentPerson', 10, 'csv');
CSV output uses dot notation for nested fields (e.g., education.university, salary.amount).
Register your own data generators:
// Register
NaijaFaker::registerProvider('religion', function ($faker) {
$religions = ['Christianity', 'Islam', 'Traditional'];
return $religions[array_rand($religions)];
});
// Use
NaijaFaker::generate('religion'); // => "Islam"
// List all registered
NaijaFaker::listProviders(); // => ['religion']
NOTE: Custom providers cannot override built-in methods.
You can give the package a quick spin by running the following artisan command:
php artisan faker:generator
composer test tests
See DISCLAIMER for details.
Please feel free to fork the package and contribute by submitting a pull request to enhance the functionalities.
Naija Faker is release under the MIT License. See LICENSE for details.
If you have any feedback, please reach out to me at [email protected]