public function installAction($package = [], $packagist = false)
{
return App::response()->stream(function () use($package, $packagist) {
try {
$package = App::package()->load($package);
if (!$package) {
throw new \RuntimeException('Invalid parameters.');
}
$this->manager->install([(string) $package->getName() => $package->get('version')], $packagist);
echo "\nstatus=success";
} catch (\Exception $e) {
printf("%s\nstatus=error", $e->getMessage());
}
});
}