JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "CrupdateLinkOverlay.php"

Full Path: /home/markqprx/iniasli.pro/app-20260222054312/Actions/Overlay/CrupdateLinkOverlay.php
File size: 867 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Actions\Overlay;

use App\Models\LinkOverlay;
use Auth;

class CrupdateLinkOverlay
{
    public function __construct(protected LinkOverlay $overlay)
    {
    }

    public function execute(
        array $data,
        LinkOverlay $overlay = null
    ): LinkOverlay {
        if (!$overlay) {
            $overlay = $this->overlay->newInstance(['user_id' => Auth::id()]);
        }

        $attributes = [
            'name' => $data['name'],
            'position' => $data['position'],
            'theme' => $data['theme'] ?? 'default',
            'message' => $data['message'],
            'label' => $data['label'],
            'btn_link' => $data['btn_link'],
            'btn_text' => $data['btn_text'],
            'colors' => $data['colors'],
        ];

        $overlay->fill($attributes)->save();

        return $overlay;
    }
}