formatting

This commit is contained in:
denisdulici
2019-11-16 17:38:48 +03:00
parent 0d53067f7b
commit a8c5aa7efd
5 changed files with 15 additions and 17 deletions

View File

@ -26,21 +26,19 @@ class CreateInvoiceTransaction
} catch (\Exception $e) {
$message = $e->getMessage();
$user = user();
if ($user) {
if ($user->contact) {
flash($message)->error();
redirect()->route('portal.invoices.show', $invoice->id)->send();
}
throw new \Exception($message);
if (!$user = user()) {
flash($message)->error();
redirect()->route('signed.invoices.show', $invoice->id)->send();
}
flash($message)->error();
if ($user->can('read-client-portal')) {
flash($message)->error();
redirect()->route('signed.invoices.show', $invoice->id)->send();
redirect()->route('portal.invoices.show', $invoice->id)->send();
}
throw new \Exception($message);
}
}
}