File: D:/HostingSpaces/SBogers110/franciscaansebeweging.nl/app/Komma/Highlighted/HighlightsComposer.php
<?php
/**
* Short description for the file.
*
* @author Komma <support@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Highlighted;
use Illuminate\Foundation\Composer;
use Komma\Activities\ActivityService;
use Komma\Posts\PostService;
use Komma\Retreats\RetreatService;
use Komma\Travels\TravelService;
use Komma\Vacancies\VacancyService;
class HighlightsComposer
{
public function __construct()
{
}
public function compose($view)
{
$vacancyService = app()->make(VacancyService::class);
$retreatsService = app()->make(RetreatService::class);
$travelService = app()->make(TravelService::class);
$activityService = app()->make(ActivityService::class);
$postService = app()->make(PostService::class);
$travels = $travelService->getAllTravels(false, 3, null, true);
$travels = $travelService->convertForSorting($travels);
$activities = $activityService->getAllActivities(false, 3, null, true);
$activities = $activityService->convertForSorting($activities);
$retreats = $retreatsService->getAllRetreats(false, 3, null, true);
$retreats = $retreatsService->convertForSorting($retreats);
$vacancies = $vacancyService->getAllVacancies(false, 3, true);
$vacancies = $vacancyService->convertForSorting($vacancies);
$posts = $postService->getAllPosts(false, 3, null, true);
$posts = $postService->convertForSorting($posts);
$finalArray = array_merge($travels, $vacancies, $retreats, $activities, $posts);
$showArray = array_slice($finalArray, 0, 3);
$view->with(['highlights'=> $showArray]);
}
}