<?php
namespace App\Livewire;
use Livewire\Component;
use Livewire\Attributes\Lazy;
#[Lazy]
class ModelStatusLivewireComponent extends Component
{
public $record;
public ?string $longAttributeToCompute = null;
public function mount($record)
{
$this->record = $record;
sleep(7); // Simulate a 5 to 7 seconds long api call that will do a compute based on some record attributes
$this->longAttributeToCompute = $record->name;
}
public function render()
{
return view('livewire.model-status-livewire-component');
}
}
<?php
namespace App\Livewire;
use Livewire\Component;
use Livewire\Attributes\Lazy;
#[Lazy]
class ModelStatusLivewireComponent extends Component
{
public $record;
public ?string $longAttributeToCompute = null;
public function mount($record)
{
$this->record = $record;
sleep(7); // Simulate a 5 to 7 seconds long api call that will do a compute based on some record attributes
$this->longAttributeToCompute = $record->name;
}
public function render()
{
return view('livewire.model-status-livewire-component');
}
}