refactor: upgrade to Livewire 4

This commit is contained in:
Benjamin Nussbaum 2026-01-14 23:59:00 +01:00
parent c94dd89361
commit a15645ad88
56 changed files with 166 additions and 278 deletions

View file

@ -1,6 +1,6 @@
<?php
use Livewire\Volt\Component;
use Livewire\Component;
use Illuminate\Support\Collection;

View file

@ -1,7 +1,7 @@
<?php
use App\Models\Plugin;
use Livewire\Volt\Component;
use Livewire\Component;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;

View file

@ -1,7 +1,7 @@
<?php
use App\Models\Plugin;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public Plugin $plugin;
@ -17,7 +17,7 @@ new class extends Component {
{
abort_unless(auth()->user()->plugins->contains($this->plugin), 403);
abort_unless($this->plugin->plugin_type === 'image_webhook', 404);
$this->name = $this->plugin->name;
}
@ -272,11 +272,11 @@ new class extends Component {
copyable
/>
<flux:description class="mt-2">POST an image (PNG or BMP) to this URL to update the displayed image.</flux:description>
<flux:callout variant="warning" icon="exclamation-circle" class="mt-4">
<flux:callout.text>Images must be posted in a format that can directly be read by the device. You need to take care of image format, dithering, and bit-depth. Check device logs if the image is not shown.</flux:callout.text>
</flux:callout>
</div>
</div>

View file

@ -1,7 +1,7 @@
<?php
use App\Models\Plugin;
use Livewire\Volt\Component;
use Livewire\Component;
use Illuminate\Support\Str;
new class extends Component {
@ -50,7 +50,7 @@ new class extends Component {
public function deleteInstance(int $pluginId): void
{
abort_unless(auth()->user() !== null, 403);
$plugin = Plugin::where('id', $pluginId)
->where('user_id', auth()->id())
->where('plugin_type', 'image_webhook')

View file

@ -2,7 +2,7 @@
use App\Console\Commands\ExampleRecipesSeederCommand;
use App\Services\PluginImportService;
use Livewire\Volt\Component;
use Livewire\Component;
use Livewire\WithFileUploads;
use Illuminate\Support\Str;

View file

@ -2,7 +2,7 @@
use App\Jobs\GenerateScreenJob;
use Illuminate\Support\Collection;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {

View file

@ -5,7 +5,7 @@ use App\Models\Plugin;
use App\Models\DeviceModel;
use Illuminate\Support\Carbon;
use Keepsuit\Liquid\Exceptions\LiquidException;
use Livewire\Volt\Component;
use Livewire\Component;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;

View file

@ -2,7 +2,7 @@
use App\Models\Plugin;
use Illuminate\Validation\Rule;
use Livewire\Volt\Component;
use Livewire\Component;
/*
* This component contains the TRMNL Plugin Settings modal