You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
add context to livewire Stamp
This commit is contained in:
@@ -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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user