tusharkhan/banglafaker
BanglaFaker is a Laravel/PHP package for generating realistic Bangladeshi fake data, including names, addresses, phone numbers, and other locale-specific details. Ideal for seeding databases, testing forms, and building demos with authentic Bengali test data quickly and easily.
BanglaFaker is a Laravel package for generating Bangladeshi-localised fake data — names, addresses, phone numbers, and similar. Release 2.1.1 is a compatibility-only release (composer.json updated for Laravel 12 support), so there is no new API to learn; the value of upgrading is forward compatibility.
Install with Composer:
composer require tusharkhan/banglafaker
On 2.1.1 the constraint now allows Laravel 12, so existing projects on Laravel 10/11 and new Laravel 12 projects can install it without --ignore-platform-reqs workarounds or dev-main pins.
Publish config / register the service provider if the package requires it (older Laravel versions need manual registration in config/app.php; Laravel 11+ uses auto-discovery). Check vendor/tusharkhan/banglafaker/config/ after install for a publishable config.
First use case: seed a development database with realistic Bangladeshi users.
use TusharKhan\BanglaFaker\BanglaFaker;
User::factory()->create([
'name' => BanglaFaker::name(),
'phone' => BanglaFaker::phoneNumber(),
'address' => BanglaFaker::address(),
]);
If the package registers itself as a Faker provider, you may instead call it via fake()->bn_BD style locales — check src/ to confirm which surface you actually have.
Where to look first: src/ for the public methods, and composer.json to confirm the illuminate/support constraint matches your app.
Factory integration. The most useful day-to-day pattern is wrapping the package inside model factories so tests and seeders get consistent Bangladeshi data without repeating calls:
class CustomerFactory extends Factory
{
public function definition(): array
{
return [
'name' => BanglaFaker::name(),
'phone' => BanglaFaker::phoneNumber(),
'address' => BanglaFaker::address(),
];
}
}
Seeding vs. tests. Use BanglaFaker for seeders where realism matters (demos, staging), but prefer fixed fixtures in assertions — random data makes tests flaky.
Localisation-aware validation. If your app validates BD phone formats (e.g. 01[3-9]\d{8}), generate with BanglaFaker and validate in the same test to prove your rules accept real-world shapes.
Compatibility pinning. Since 2.1.1 only changes the Composer constraint, treat it as a patch bump: run the upgrade in CI on Laravel 12 first, then roll it out. No code changes should be needed across 2.0.0 → 2.1.1.
Blade/demo tooling. For internal dashboards or demo pages, wrap calls in a small helper so you can swap in real data later without hunting down call sites.
minimum-stability: dev or a git branch alias, replace that with the tagged ^2.1 constraint and verify composer.lock actually updated.fakerphp/faker's own bn_BD provider. Check config/app.php / the service provider before assuming which one is answering.utf8mb4 and that responses set Content-Type: text/html; charset=UTF-8, otherwise names render as ????.fake() for other fields. Setting a BD locale or using BanglaFaker only affects the fields the package covers; emails/domains may still come out Western — fine for staging, but don't promise "fully localised" data.vendor:publish was done earlier, it does not need re-running — but diff the package's config against yours if you're jumping from an older minor.^2.1; in first-party apps, ^2.1 is safe given the patch-only nature of this release.php artisan tinker → BanglaFaker::name() isolates package output from Faker's, which quickly tells you whether the issue is provider registration or encoding.How can I help you explore Laravel packages today?