Luukd_2000
Hide a resource widget based on the resource status
protected function getHeaderWidgets(): array
{
$widgets = [];
// Access the current record using $this->record
$website = $this->record;
// Check if the relationship count is 0
if ($website && $website->websiteChecks()->count() === 0) {
$widgets[] = WebsiteResource\Widgets\WebsiteConnection::class;
}
return $widgets;
}
12 replies