Seeders Not Working After NativePHP Build – How to Fix? #505
Unanswered
KamilTahirli
asked this question in
Q&A
Replies: 1 comment 4 replies
-
This is correct behaviour. Seeders should ideally only be run in dev usually. Although you used the prebuild key, the database is wiped out and made fresh for the build. If you want the seeders to run in Production, you might want to add some logic to your service providers boot method to see if it's been seeded yet and if not, call |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am running NativePHP integrated with Laravel.
I have a CategorySeeder, which is called inside DatabaseSeeder. In my development environment, when I run php artisan native:db:seed, the seeder correctly sets the data into the SQLite database.
However, after running php artisan native:build on Linux, my seeders do not work.
Even if I add the following inside NativeServiceProvider:
Artisan::call('native:db:seed');
It still has no effect after the build.
Additionally, I added this to /config/nativephp.php:
'prebuild' => [
'php artisan native:migrate',
'php artisan native:db:seed'
],
But this also had no effect.
What do you recommend at this stage?
Beta Was this translation helpful? Give feedback.
All reactions