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/SBogers10/finsteps.komma.pro/app/Composers/CalloutBarComposer.php
<?php


namespace App\Composers;


use App\WebsiteConfig\Model\WebsiteConfig;
use App\Buttons\Models\Button;
use Illuminate\View\View;

class CalloutBarComposer
{
    /**
     * @param View $view
     */
    public function compose(View $view)
    {
        $calloutBarHeading = WebsiteConfig::where('code_name', '=', 'global_CTA_heading')->first()->value ?? null;
        $calloutBarPhoneDisplay = WebsiteConfig::where('code_name', '=', 'company_phone_display')->first()->value ?? null;
        $calloutBarPhoneCall = WebsiteConfig::where('code_name', '=', 'company_phone_call')->first()->value ?? null;
        $calloutBarButtonId = WebsiteConfig::where('code_name', '=', 'global_CTA_button_id')->first()->value ?? null;
        $calloutBarButton = Button::where('id', $calloutBarButtonId)->with('translations')->first() ?? null;

        $view->with([
            'calloutBarHeading' => $calloutBarHeading,
            'calloutBarPhoneDisplay' => $calloutBarPhoneDisplay,
            'calloutBarPhoneCall' => $calloutBarPhoneCall,
            'calloutBarButtonText' => $calloutBarButton->translation->label ?? null,
            'calloutBarButtonLink' => $calloutBarButton->translation->url ?? null,
        ]);
    }
}