<?php

namespace Shm\ShmAddons\AdminActions;

class AdminActionResult
{


    public $url = null;
    public $message = null;


    public static function success(string $message): self
    {
        $result = new self();
        $result->message = $message;

        return $result;
    }



    public function url(string $url): self
    {
        $this->url = $url;
        return $this;
    }


    public function json(): array
    {
        return [
            'payload' => [
                'url' => $this->url,
                'message' => $this->message,
            ]
        ];
    }
}