isLivewireClickHandlerEnabled()) { return null; } if (is_string($this->action)) { return $this->action; } $argumentsParameter = ''; if (count($arguments = $this->getArguments())) { $argumentsParameter .= ', '; $argumentsParameter .= Js::from($arguments); } return "mountAction('{$this->getName()}'{$argumentsParameter})"; } /** * @return array */ protected function resolveDefaultClosureDependencyForEvaluationByName(string $parameterName): array { return match ($parameterName) { 'model' => [$this->getModel()], 'record' => [$this->getRecord()], 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 getLivewire(): Component { return $this->livewire; } public function shouldClearRecordAfter(): bool { return ! $this->getRecord()?->exists; } public function clearRecordAfter(): void { if (! $this->shouldClearRecordAfter()) { return; } $this->record(null); } public function getInfolistName(): string { return 'mountedActionInfolist'; } }