File: D:/HostingSpaces/SBogers10/netwerkbrabant.komma.pro/app/KommaApp/CourseTypes/CourseTypeComposer.php
<?php
namespace App\KommaApp\CourseTypes;
use App\KommaApp\CourseTypes\Models\CourseType;
use Illuminate\View\View;
class CourseTypeComposer
{
public static $courseTypes;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
// Only load the partners if the static isn't filled yet
if(!static::$courseTypes){
static::$courseTypes = CourseType::with('translation')->get();
}
$view->with('courseTypes', static::$courseTypes);
}
}