File: D:/HostingSpaces/Anvil/anvil-industries.com/app/KommaApp/Specialisms/SpecialismComposer.php
<?php
namespace App\KommaApp\Specialisms;
use Illuminate\View\View;
class SpecialismComposer
{
static $specialisms;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
// Only load the specialisms once
if(!static::$specialisms){
static::$specialisms = \App::getSite()
->specialisms()
->with('translation')
->where('active', 1)
->where('lft', '!=', 1)
->orderBy('lft')
->get();
}
$view->with('menuSpecialisms', static::$specialisms);
}
}