mubiridziri/faker
A lightweight fake-data generator for Laravel and PHP that quickly produces realistic names, emails, addresses, phone numbers, and more. Simple to install and easy to extend with custom providers, it's ideal for tests, seeders, demos, and populating databases during development.
composer require <vendor>/<package>) — the service provider is auto-discovered in Laravel.README and src/ directory for available generators. In 1.2, the new RandomPhoneNumber and RandomDateTimeThisMonth classes are the quickest wins.UserFactory can use RandomPhoneNumber for the phone field and RandomDateTimeThisMonth for created_at or a monthly subscription date, giving realistic, varied test data without extra setup.generate() method, use 'phone' => RandomPhoneNumber::generate(); otherwise instantiate and invoke. For bulk seeding, loop over the generator to produce many records.RandomDateTimeThisMonth when testing monthly reports, billing cycles, or “this month” filters. It guarantees dates fall inside the current calendar month, avoiding flaky tests that break when run at month boundaries.phoneNumber() for those cases and use RandomPhoneNumber for generic or quick stubs.setUp() to make generated values reproducible across test runs.RandomPhoneNumber may produce generic or non-locale-aware numbers. For validation-heavy tests (e.g., phone:US), fall back to Faker’s locale-specific provider or wrap the output with a formatter.RandomDateTimeThisMonth relies on the current date. Ensure config('app.timezone') is set correctly in your test environment; otherwise “this month” may shift unexpectedly when comparing against UTC-stored timestamps.travelTo() or Carbon’s setTestNow() before generating.phoneNumber and dateTimeThisMonth formatters. Avoid importing both without aliases, and prefer the package’s classes only where you need standalone generation outside a Faker instance.composer update and verify your factories still pass; add the new generators incrementally where they replace ad-hoc rand() or Carbon calls.How can I help you explore Laravel packages today?