FilamentF
Filamentโ€ข3y ago
zoomZoom

Actions : disabled() and hidden() are the same

public function editAction()
{
    return Action::make('edit')
        ->icon('heroicon-m-pencil-square')
        // ->iconButton()
        ->mountUsing(function (array $arguments, Form $form) {
            $this->article = ArticleModel::find($arguments['articleId']);
            // $form->fill($this->article->toArray());
            $form->fill([
                'title' => $this->article->title,
            ]);
        })
        ->form([
            TextInput::make('title')
                ->label('Titre')
                ->required(),
        ])
        ->action(function (array $data): void {
            $this->article->update($data);
        })->hidden(true);
}

<div> {{ ($this->editAction)(['articleId' => $article->id]) }} </div>


If i do hidden(true) the result is the same as disabled() .

The button is there but not clickable.

Is this the wanted behavior ? I thought hidden meant not visible ?

Have a good day ! ๐Ÿš€
Screenshot_2023-10-30_at_11.16.58.jpg
Was this page helpful?