isLivewireClickHandlerEnabled()) { return null; } if (is_string($this->action)) { return $this->action; } if ($record = $this->getRecord()) { $recordKey = $this->getLivewire()->getTableRecordKey($record); return "mountTableAction('{$this->getName()}', '{$recordKey}')"; } return "mountTableAction('{$this->getName()}')"; } /** * @return array */ protected function resolveDefaultClosureDependencyForEvaluationByName(string $parameterName): array { return match ($parameterName) { 'model' => [$this->getModel()], 'record' => [$this->getRecord()], 'table' => [$this->getTable()], default => parent::resolveDefaultClosureDependencyForEvaluationByName($parameterName), }; } /** * @return array */ protected function resolveDefaultClosureDependencyForEvaluationByType(string $parameterType): array { $record = $this->getRecord(); if (! $record) { return parent::resolveDefaultClosureDependencyForEvaluationByType($parameterType); } return match ($parameterType) { Model::class, $record::class => [$record], default => parent::resolveDefaultClosureDependencyForEvaluationByType($parameterType), }; } public function getRecordTitle(?Model $record = null): string { $record ??= $this->getRecord(); return $this->getCustomRecordTitle($record) ?? $this->getTable()->getRecordTitle($record); } public function getRecordTitleAttribute(): ?string { return $this->getCustomRecordTitleAttribute() ?? $this->getTable()->getRecordTitleAttribute(); } public function getModelLabel(): string { return $this->getCustomModelLabel() ?? $this->getTable()->getModelLabel(); } public function getPluralModelLabel(): string { return $this->getCustomPluralModelLabel() ?? $this->getTable()->getPluralModelLabel(); } public function getModel(): string { return $this->getCustomModel() ?? $this->getTable()->getModel(); } public function prepareModalAction(StaticAction $action): StaticAction { $action = parent::prepareModalAction($action); if (! $action instanceof Action) { return $action; } return $action ->table($this->getTable()) ->record($this->getRecord()); } public function getInfolistName(): string { return 'mountedTableActionInfolist'; } }