Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Szyfr's avatar
Level 3

How to seed database after deploying the Laravel app on production?

How to seed database after deploying the Laravel app on production?

0 likes
9 replies
richard's avatar

You just seed the same way you seed on development: php artisan db:seed

Szyfr's avatar
Level 3

@richard thanks for the reply,

it throws

Class 'Faker\Factory' not found
zachleigh's avatar

What does your seed look like? You probably dont want to seed fake data on production....

zachleigh's avatar

I would just log on to my server and create an admin user record... What does your seed class look like?

Szyfr's avatar
Level 3

@zachleigh oh i see, thanks! can i just log in mysql and import may users and permissions table?

zachleigh's avatar
Level 47

Yes. You can import your whole database if you want.

willvincent's avatar

Probably best to just ssh into the box and manually create your admin user via tinker though.

sardar1592's avatar

Yes, SSH into your server and tinker. That is the best way. Run factory command like

factory(App\Product::class, 50)->create(); directly from tinker command line to quickly get upto speed.

Please or to participate in this conversation.