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

@ -3,9 +3,9 @@
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Volt\Component;
use Livewire\Component;
new #[Layout('components.layouts.auth')] class extends Component {
new #[Layout('layouts.auth')] class extends Component {
public string $password = '';
/**

View file

@ -2,9 +2,9 @@
use Illuminate\Support\Facades\Password;
use Livewire\Attributes\Layout;
use Livewire\Volt\Component;
use Livewire\Component;
new #[Layout('components.layouts.auth')] class extends Component {
new #[Layout('layouts.auth')] class extends Component {
public string $email = '';
/**

View file

@ -8,9 +8,9 @@ use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Attributes\Validate;
use Livewire\Volt\Component;
use Livewire\Component;
new #[Layout('components.layouts.auth')] class extends Component {
new #[Layout('layouts.auth')] class extends Component {
#[Validate('required|string|email')]
public string $email = '';
@ -131,10 +131,10 @@ new #[Layout('components.layouts.auth')] class extends Component {
</div>
<div class="flex items-center justify-end">
<flux:button
variant="outline"
type="button"
class="w-full"
<flux:button
variant="outline"
type="button"
class="w-full"
href="{{ route('auth.oidc.redirect') }}"
>
{{ __('Continue with OIDC') }}

View file

@ -6,9 +6,9 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules;
use Livewire\Attributes\Layout;
use Livewire\Volt\Component;
use Livewire\Component;
new #[Layout('components.layouts.auth')] class extends Component {
new #[Layout('layouts.auth')] class extends Component {
public string $name = '';
public string $email = '';
public string $password = '';

View file

@ -8,9 +8,9 @@ use Illuminate\Support\Str;
use Illuminate\Validation\Rules;
use Livewire\Attributes\Layout;
use Livewire\Attributes\Locked;
use Livewire\Volt\Component;
use Livewire\Component;
new #[Layout('components.layouts.auth')] class extends Component {
new #[Layout('layouts.auth')] class extends Component {
#[Locked]
public string $token = '';
public string $email = '';

View file

@ -4,9 +4,9 @@ use App\Livewire\Actions\Logout;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Livewire\Attributes\Layout;
use Livewire\Volt\Component;
use Livewire\Component;
new #[Layout('components.layouts.auth')] class extends Component {
new #[Layout('layouts.auth')] class extends Component {
/**
* Send an email verification notification to the user.
*/

View file

@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Livewire\Attributes\Lazy;
use Livewire\Volt\Component;
use Livewire\Component;
use Symfony\Component\Yaml\Yaml;
new

View file

@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Livewire\Attributes\Lazy;
use Livewire\Volt\Component;
use Livewire\Component;
new
#[Lazy]

View file

@ -1,6 +1,6 @@
<?php
use Livewire\Volt\Component;
use Livewire\Component;
use Livewire\Attributes\Modelable;
new class extends Component
@ -40,7 +40,7 @@ new class extends Component
} ?>
<div
<div
x-data="codeMirrorComponent(@js($language), @js($theme), @js($readonly), @js($placeholder), @js($height), @js($id ?: uniqid()))"
x-init="init()"
wire:ignore
@ -58,7 +58,7 @@ new class extends Component
<span>Loading editor...</span>
</div>
</div>
<!-- Editor container -->
<div x-show="!isLoading" x-ref="editor" style="height: {{ $height }};"></div>
</div>

View file

@ -1,6 +1,6 @@
<?php
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public function mount()

View file

@ -2,7 +2,7 @@
use App\Models\DeviceModel;
use App\Models\DevicePalette;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component
{

View file

@ -1,7 +1,7 @@
<?php
use App\Models\DevicePalette;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component
{

View file

@ -5,7 +5,7 @@ use App\Models\DeviceModel;
use App\Models\Firmware;
use App\Models\Playlist;
use App\Models\PlaylistItem;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {

View file

@ -2,7 +2,7 @@
use App\Models\Device;
use App\Models\DeviceLog;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public Device $device;

View file

@ -2,7 +2,7 @@
use App\Models\Device;
use App\Models\DeviceModel;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {

View file

@ -3,7 +3,7 @@
use App\Models\Device;
use App\Models\Playlist;
use App\Models\PlaylistItem;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public $devices;

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

View file

@ -1,6 +1,6 @@
<?php
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
//

View file

@ -2,7 +2,7 @@
use App\Livewire\Actions\Logout;
use Illuminate\Support\Facades\Auth;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public string $password = '';

View file

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules\Password;
use Illuminate\Validation\ValidationException;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public string $current_password = '';

View file

@ -6,7 +6,7 @@ use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Illuminate\Validation\Rule;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public ?int $assign_new_device_id = null;

View file

@ -4,7 +4,7 @@ use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Illuminate\Validation\Rule;
use Livewire\Volt\Component;
use Livewire\Component;
new class extends Component {
public string $name = '';

View file

@ -1,3 +1,8 @@
<?php
use Livewire\Component;
new class extends Component {}
?>
<section class="w-full">
@include('partials.settings-heading')