HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/posscale/public_html/printmanager/app/Http/Livewire/TenantAction.php
<?php

namespace App\Http\Livewire;

use App\Models\Tenant;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Livewire\Component;
use Filament\Forms\Form;

class TenantAction extends Component implements HasForms
{
    use InteractsWithForms;
    public Tenant $tenant;
    public bool $codeRequested = false;
    public function mount($tenant): void
    {   
        // $this->tenant = $tenant;
        $this->form->fill();
    }


    public function actionForm(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('name')->required()->hidden($this->codeRequested),
                TextInput::make('phone')->required()->hidden($this->codeRequested),
                TextInput::make('code')
                    ->required($this->codeRequested)
                    ->visible($this->codeRequested),
            ])
            ->statePath('data');
    }

    public function render()
    {
        return view('livewire.tenant-action');
    }
}