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

r10maro90's avatar

Seeding data to Laravel Forge not working

I've hit a roadblock with Laravel Forge, couldn't find any updated tuts on how to seed data to production.

When I run this 'php artisan db:seed --class=CountrySeeder' command locally it works.

I tried adding in the 'deploy script' section in Forge but it didn't work. https://pasteboard.co/JDs4c6l.png

Any help would be appreciated.

0 likes
2 replies
Nakov's avatar
Nakov
Best Answer
Level 73

Do you need to apply the seeder each time you deploy to the server?

And you are not showing what was the error, it is hard to guess now.

But if I took a chance to guess is because it couldn't find the seeder class in which case it can be fixed using composer dump-autoload.

But for a Seeder to be run, I wouldn't add it to the deploy script but SSH to the server and run the command only once.

1 like
r10maro90's avatar

I did this "But for a Seeder to be run, I wouldn't add it to the deploy script but SSH to the server and run the command only once." and it worked!

I logged into to the digital ocean droplet from my local machine, cd into the folder and ran the command.

Thanks for the help!

Please or to participate in this conversation.