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/SBogers95/rentman.io/app/Komma/Integrations/IntegrationComposer.php
<?php

namespace App\Komma\Integrations;

use App\Komma\Integrations\Models\Integration;

class IntegrationComposer
{
    public function compose($view)
    {
        $integrations = Integration::with('translation', 'images')
            ->has('images')
            // We need to use a join to select the active solution because that is defined on the translations
            ->join('integration_translations', 'integrations.id', '=',
                'integration_translations.integration_id')
            ->select('integrations.*', 'integration_translations.active', 'integration_translations.language_id')
            ->where('active', 1)
            ->where('show_in_component', 1)
            ->where('language_id', \App::getLanguage()->id)
            ->orderBy('lft')
            ->get();

        $view->with(['composedIntegrations' => $integrations]);
    }
}