How do I Determine What Action is Called?
Apologies if this is covered in the filament docs, however, i couldn't find anything based on this issue.
I have the following in my AuthorResource:
```
Forms\Components\TextInput::make('email')
->label('Email')
->required()
->email()
->columnSpan(['sm' => 2])
->unique(modifyRuleUsing: function (Unique $rule) {
return $rule->where('is_published', 1);
}),
and this in the EditAuthor:
Action::make('save')
->action('save')
->label(fn (EditRecord $livewire) => $livewire->getRecord()->isPublished() ? __('filament-panels::resources/pages/edit-record.form.actions.save.label')
: 'Publish')
->icon(fn (EditRecord $livewire) => $livewire->getRecord()->isPublished() ? 'heroicon-o-check-circle' : 'heroicon-o-eye'),
how can i check that if the action "save" is called, then I should apply the ->unique rule that I have set, and if anything other than action "save" don't apply the unique rule.
Solution:Jump to solution
I've found an alternative solution. I've done this:
```
->rules([
function () {...
1 Reply
Solution
I've found an alternative solution. I've done this: