File: D:/HostingSpaces/SBogers60/vandeurzenheftrucks.nl/app/Komma/Vacancies/Composers/VacanciesAmount.php
<?php
namespace Komma\Vacancies\Composers;
use Komma\Vacancies\VacancyService;
class VacanciesAmount
{
static $vacancyAmounts;
private $vacancyService;
public function __construct(VacancyService $vacancyService)
{
$this->vacancyService = $vacancyService;
}
public function compose($view)
{
if(!static::$vacancyAmounts){
static::$vacancyAmounts = $this->vacancyService->countVacancies();
}
$view->with(['vacancyAmount'=> static::$vacancyAmounts]);
}
}