1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/app/Utils/Traits/MakesHeaderData.php
David Bomba cdb98ce528
View Composers + JS testing framework (#2521)
* Add Jest testing to travis

* View Composers

* Composers
2018-11-26 15:15:08 +11:00

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;
}
}