HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
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]);
    }
}