Creating Realistic Testing Data With Factories

When developing an application with Laravel, having consistent test data is important. Whenever you create a new model with a factory via Artisan (php artisan make:model), you have the option of creating a factory alongside it by passing the -f option. Factories are where you define the shape of a model (which fields get which […]