Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Banglafaker Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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.

  1. 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.

  2. 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.

  3. 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.

Implementation Patterns

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.

Gotchas and Tips

  • This release is Composer-only. If you were previously running Laravel 12 with minimum-stability: dev or a git branch alias, replace that with the tagged ^2.1 constraint and verify composer.lock actually updated.
  • Conflict with other Faker locale providers. If the package registers a Faker locale provider, it can clash with fakerphp/faker's own bn_BD provider. Check config/app.php / the service provider before assuming which one is answering.
  • Character encoding. Bangla output is UTF-8. Ensure your DB columns are utf8mb4 and that responses set Content-Type: text/html; charset=UTF-8, otherwise names render as ????.
  • Locale doesn't change 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.
  • No migration/config changes in 2.1.1. If a 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.
  • Pin in libraries, float in apps. If you build packages that depend on BanglaFaker, use ^2.1; in first-party apps, ^2.1 is safe given the patch-only nature of this release.
  • Debugging odd output. php artisan tinker → BanglaFaker::name() isolates package output from Faker's, which quickly tells you whether the issue is provider registration or encoding.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager