if you write laravel projects, then you've probably written some database seeders and maybe some factories to create some convincing fake data to fill out your tables so you have something to show your client. in these instances, it's worthwhile to have a seeding strategy that's fast and flexible.

/** * Run seeders */ array_map(fn($s) => $this->call($s), $seeds); Exit fullscreen mode #making-seed-files-from-your-db making seed files from your db ideally, we should never get ourselves in a situation where we need to create seed files from a database that already exists.

Exit fullscreen mode once it's installed, creating seeds files from our database is as simple as running: artisan gbhorwood:pollinate Exit fullscreen mode this will create seed files for all the tables in our database, with a few exceptions: system tables, such as those for jobs, migrations, passport and the like empty tables if we look in our database/seeders directory, we will see our seed files there.
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