mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 05:32:39 +01:00
cdb98ce528
* Add Jest testing to travis * View Composers * Composers
31 lines
587 B
PHP
31 lines
587 B
PHP
<?php
|
|
|
|
namespace App\Utils\Traits;
|
|
|
|
|
|
/**
|
|
* Class MakesHash
|
|
* @package App\Utils\Traits
|
|
*/
|
|
trait MakesHeaderData
|
|
{
|
|
|
|
use UserSessionAttributes;
|
|
|
|
public function headerData()
|
|
{
|
|
//companies
|
|
$companies = auth()->user()->companies;
|
|
|
|
$data['current_company'] = $companies->first(function ($company){
|
|
return $company->id == $this->getCurrentCompanyId();
|
|
});
|
|
|
|
$data['companies'] = $companies->reject(function ($company){
|
|
return $company->id == $this->getCurrentCompanyId();
|
|
});
|
|
|
|
return $data;
|
|
}
|
|
|
|
} |