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/werkenbij.komma.pro/app/Komma/Composers/TextImageComposer.php
<?php


namespace App\Komma\Composers;


use Illuminate\View\View;

class TextImageComposer
{
    /**
     * @param View $view
     */
    public function compose(View $view)
    {
        $viewData = $view->getData();

        $buttonText = null;
        $buttonLink = null;
        if(
            isset($viewData['component']) &&
            $viewData['component']->buttons &&
            count($viewData['component']->buttons) > 0 &&
            $viewData['component']->buttons[0]->translation
        ) {
            $button = $viewData['component']->buttons[0];
            $buttonText = $button->translation->label ?: null;
            $buttonLink = $button->translation->url ?: null;
        }

        if($buttonText) $view->with('buttonText', $buttonText);
        if($buttonLink) $view->with('buttonLink', $buttonLink);
    }
}