File: D:/HostingSpaces/SBogers10/anvil.komma.pro/app/KommaApp/Employees/EmployeeComposer.php
<?php
namespace App\KommaApp\Employees;
use Illuminate\View\View;
class EmployeeComposer
{
static $employees;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
// Only load the specialisms once
if(!static::$employees){
static::$employees = \App::getSite()
->employees()
->with(['translation', 'images'])
->where('active', 1)
->where('lft', '!=', 1)
->orderBy('lft')
->get();
}
$view->with('employees', static::$employees);
}
}