Category: Laravel, PHP

Further links: Legal notice and Privacy policySven Hofmann is a freelance web developer from Germany with a B.A. in Media Design from Hof University The content of hofmannsven.com focuses on web development and open source PHP frameworks like Laravel.

In Laravel, factories have access to the Faker PHP library, which allows you to generate all kinds of random data for testing.

In a Laravel factory, the syntax for the custom formatter looks like this: A test could look like this: You can use the formatter in your factories and tests. Keep in mind that fakerphp/faker is a dev dependency in Laravel, which is only available in the development environment.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners