#seeders in windows

1 messages ยท Page 1 of 1 (latest)

lime wave
#

I have tried to boot the following:

$seededFile = storage_path('app/.seeded'); 
if (!file_exists($seededFile)) { 
Artisan::call('db:seed'); 
file_put_contents($seededFile, '1'); 
}

But it doesn't work.

blissful tusk
lime wave
#

I can see this error in logs: Seeder failed: Undefined constant "STDIN"

lime wave
#

Error Flow

  1. NativePHP Application Startup

When the NativePHP application starts on Windows, the NativeServiceProvider registers and executes configureApp():

NativeServiceProvider.php:120 โ†’ configureApp()

NativeServiceProvider.php:148 โ†’ fireUpQueueWorkers()

  1. Attempt to Start Queue Workers

The fireUpQueueWorkers() method reads the configuration from config/nativephp.php:

'queue_workers' => [
  'default' => [
  'queues' => ['default'],
  'memory_limit' => 128,
  'timeout' => 60,
  'sleep' => 3,
  ]
]

And for each configured worker, it calls:

NativeServiceProvider.php:259 โ†’ QueueWorker->up()

QueueWorker.php:31 โ†’ ChildProcess->artisan()

  1. ChildProcess tries to create a PHP process

In vendor/nativephp/desktop/src/ChildProcess.php:

// Line 120-127: artisan() prepares the command 
public function artisan(...): self 
{ 
$cmd = ['artisan', ...$cmd]; 
return $this->php($cmd, $alias, ...); // Call php() 
} 

// Line 85-99: php() makes the HTTP request to the Electron runtime 
public function php(...): self 
{ 
$process = $this->client->post('child-process/start-php', [ 
'alias' => $alias, 
'cmd' => $cmd, 
'cwd' => base_path(), 
'env' => $env, 
'persistent' => $persistent, 
'iniSettings' => $iniSettings, 
])->json(); // โ† HERE: On Windows, this returns NULL 

return $this->fromRuntimeProcess($process); // Passes NULL

}