Seeders Not Working After NativePHP Build – How to Fix? #505
Replies: 2 comments 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.
-
@KamilTahirli we have similar problem. did you have solution for this? in my
but still, when i build its still give me an invalid credentials causing unable to login. |
Beta Was this translation helpful? Give feedback.
-
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