Skip to content

Instantly share code, notes, and snippets.

@jonneroelofs
jonneroelofs / Player.blade.php
Created March 1, 2022 15:23
Files belonging to Livewire explained: Emitting events using emit, emitUp and emitTo (an event based Guessing game) (https://youtu.be/DN-ABpxnrrI)
<div class="shadow border-2 rounded p-1">
<div class="flex justify-between gap-4">
<h2>Player</h2>
</div>
<x-list-texts :texts="$myText"></x-list-texts>
<div>
<x-list-listeners :listeners="$this->getListeners()"></x-list-listeners>
</div>
@jonneroelofs
jonneroelofs / Livewire\ProjectDetails.php
Last active January 14, 2024 17:01
Files belonging to the "Using wire:key and refreshing child components (troubleshooting Laravel Livewire)" video: https://youtu.be/jDEH9qw2UiQ
<?php
namespace App\Http\Livewire;
use App\Models\Project;
use It4web\TallUi\Traits\InteractsWithGlobalToastr;
use Livewire\Component;
class ProjectDetails extends Component
{
@jonneroelofs
jonneroelofs / SignatureExample.php
Created January 10, 2022 18:44
Wrapping SignaturePad and storing base-64 with Alpine.js and Laravel Livewire
<?php
namespace App\Http\Livewire;
use Illuminate\Support\Str;
use Livewire\Component;
class SignatureExample extends Component
{
public $signature;
@jonneroelofs
jonneroelofs / EventForm.php
Created December 21, 2021 13:04
Flatpickr wrapped with Alpine.js in blade component for Laravel Livewire
<?php
namespace App\Http\Livewire;
use App\Models\Event;
use Livewire\Component;
class EventForm extends Component
{
public $event;