/**
* Update the specified Links in storage.
*
* @param int $id
* @param LinksRequest $request
*
* @return Response
*/
public function update($id, LinksRequest $request)
{
try {
$links = $this->linksRepository->findLinksById($id);
if (empty($links)) {
Quarx::notification('Link not found', 'warning');
return redirect(route('quarx.links.index'));
}
$links = $this->linksRepository->update($links, $request->all());
Quarx::notification('Link updated successfully.', 'success');
if (!$links) {
Quarx::notification('Link could not be updated.', 'danger');
}
} catch (Exception $e) {
Quarx::notification($e->getMessage() ?: 'Links could not be updated.', 'danger');
}
return redirect(route('quarx.links.edit', [$id]));
}