v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@ -19,22 +19,20 @@ class Header
*/
public function compose(View $view)
{
$user = Auth::user();
$user = user();
$bills = [];
$invoices = [];
$items = [];
$items_reminder = [];
$notifications = 0;
$company = null;
// Get customer company
if ($user->customer()) {
if ($user->contact) {
$company = (object)[
'company_name' => setting('general.company_name'),
'company_email' => setting('general.company_email'),
'company_address' => setting('general.company_address'),
'company_logo' => setting('general.company_logo'),
'company_name' => setting('company.name'),
'company_email' => setting('company.email'),
'company_address' => setting('company.address'),
'company_logo' => setting('company.logo'),
];
}
@ -52,14 +50,6 @@ class Header
$invoices[$data['invoice_id']] = $data['amount'];
$notifications++;
break;
case 'App\Notifications\Common\Item':
$items[$data['item_id']] = $data['name'];
$notifications++;
break;
case 'App\Notifications\Common\ItemReminder':
$items_reminder[$data['item_id']] = $data['name'];
$notifications++;
break;
}
}
@ -72,8 +62,6 @@ class Header
'notifications' => $notifications,
'bills' => $bills,
'invoices' => $invoices,
'items' => $items,
'items_reminder' => $items_reminder,
'company' => $company,
'updates' => $updates,
]);