<?php
namespace Livewire;
use Livewire\HydrationMiddleware\AddAttributesToRootTagOfHtml;
class Response
{
public $request;
public $fingerprint;
public $effects;
public $memo;
public static function fromRequest($request)
{
return new static($request);
}
public function __construct($request)
{
$this->request = $request;
$this->fingerprint = $request->fingerprint;
$this->memo = $request->memo;
$this->effects = [];
}
public function id() { return $this->fingerprint['id']; }
public function embedThyselfInHtml()
{
if (! $html = $this->effects['html'] ?? null) return;
$this->effects['html'] = (new AddAttributesToRootTagOfHtml)($html, [
'initial-data' => $this->toArrayWithoutHtml(),
]);
}
public function embedIdInHtml()
{
if (! $html = $this->effects['html'] ?? null) return;
$this->effects['html'] = (new AddAttributesToRootTagOfHtml)($html, [
'id' => $this->fingerprint['id'],
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX