add context to livewire Stamp

This commit is contained in:
Khoubza Younes
2021-09-08 08:28:01 +01:00
parent f6b2b386b3
commit 28bb4e22b8
+20 -1
View File
@@ -4,8 +4,27 @@ declare(strict_types=1);
namespace Flasher\Livewire;
use Flasher\Prime\Stamp\PresentableStampInterface;
use Flasher\Prime\Stamp\StampInterface;
class LivewireStamp implements StampInterface
class LivewireStamp implements StampInterface, PresentableStampInterface
{
private $context;
public function __construct(array $context = [])
{
$this->context = $context;
}
public function getContext(): array
{
return $this->context;
}
public function toArray()
{
return [
'livewire_context' => $this->getContext(),
];
}
}