diff --git a/public/installer/Seeder.php b/public/installer/Seeder.php index a28739b25..aeb1b2bd6 100755 --- a/public/installer/Seeder.php +++ b/public/installer/Seeder.php @@ -1,21 +1,41 @@ &1'; -$seeder = 'cd ../.. && '. $phpbin .' artisan db:seed 2>&1'; -$publish = 'cd ../.. && '. $phpbin .' artisan vendor:publish --all --force 2>&1'; +/* commands sequence */ +$commands = [ + 'seeder' => [ + 'key' => 'seeder_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan db:seed 2>&1' + ], + 'publish' => [ + 'key' => 'publish_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan vendor:publish --all --force 2>&1' + ], + 'storage_link' => [ + 'key' => 'storage_link_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan storage:link 2>&1' + ], + 'key' => [ + 'key' => 'key_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan key:generate 2>&1' + ], + 'optimize' => [ + 'key' => 'optimize_results', + 'command' => 'cd ../.. && '. $phpbin .' artisan optimize 2>&1' + ], +]; -$key_output = exec($key, $data['key'], $data['key_results']); -$seeder_output = exec($seeder, $data['seeder'], $data['seeder_results']); -$publish = exec($publish, $data['publish'], $data['publish_results']); +// run command on terminal +$data = []; +foreach ($commands as $key => $value) { + exec($value['command'], $data[$key], $data[$value['key']]); +} // return a response -//return all our data to an AJAX call - +// return all our data to an AJAX call echo json_encode($data);