Skip to main content

Posts

Showing posts with the label laravel 8 factory faker

Laravel 8 Factory Example Tutorial

Hi Guys In this tutorial, I will learn how to generate dummy records in your database table using tinker factory of Laravel 8. As I know testing is very important part of any web development project. Sometime we may require to add hundreds records in your users table, OR maybe thousands of records. Also think about if you require to check pagination. then you have to add some records for testing. So what you will do it at that that moment, You will add manually thousands of records ? What you do ?. If you add manually thousands of records then it can be take more time. Here,Laravel 8 have composer package "laravel/tinker" that we will provide you to generate dummy records by using their command. So Laravel 8 by default take "laravel/tinker" package for project. Also they provide by default one factory for user table. You can check path here : database/factories/. In this folder you can add your different factory for different model. Generate Dummy Products: php a