public function update(Request $request)
{
$package = $request->get('package') ? $request->get('package') : null;
$update = $package ? [$package] : [];
try {
$response = $this->app['extend.manager']->updatePackage($update);
} catch (\Exception $e) {
return $this->getJsonException($e);
}
if ($response === 0) {
$this->app['logger.system']->info("Updated {$package}", ['event' => 'extensions']);
return $this->json($this->manager()->getOutput());
}
return $this->getJsonException(new PackageManagerException($this->manager()->getOutput(), $response));
}