55 lines
1.3 KiB
PHP
Executable File
55 lines
1.3 KiB
PHP
Executable File
<?php
|
|
namespace App\Filament\Pages\Supporto;
|
|
|
|
use App\Models\User;
|
|
use BackedEnum;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use UnitEnum;
|
|
|
|
class TicketAcquaLight extends TicketAcqua
|
|
{
|
|
protected static ?string $navigationLabel = 'Ticket Acqua Light';
|
|
|
|
protected static ?string $title = 'Ticket Acqua Light';
|
|
|
|
protected static BackedEnum|string|null $navigationIcon = 'heroicon-o-bolt';
|
|
|
|
protected static UnitEnum|string|null $navigationGroup = 'Mobile';
|
|
|
|
protected static ?int $navigationSort = 27;
|
|
|
|
protected static ?string $slug = 'supporto/ticket-acqua-light';
|
|
|
|
protected string $view = 'filament.pages.supporto.ticket-acqua-light';
|
|
|
|
public function mount(): void
|
|
{
|
|
parent::mount();
|
|
|
|
if (! request()->integer('unita')) {
|
|
$this->resetLightUnitSelection();
|
|
}
|
|
}
|
|
|
|
public function updatedStabileId(): void
|
|
{
|
|
parent::updatedStabileId();
|
|
|
|
$this->resetLightUnitSelection();
|
|
}
|
|
|
|
private function resetLightUnitSelection(): void
|
|
{
|
|
$user = Auth::user();
|
|
|
|
$this->unitaId = null;
|
|
$this->unitaSearch = '';
|
|
$this->previousReading = null;
|
|
$this->suggestedReaderName = null;
|
|
|
|
if ($user instanceof User) {
|
|
$this->rilevatoreNome = trim((string) $user->name) ?: $this->rilevatoreNome;
|
|
}
|
|
}
|
|
}
|