mmoollllee
mmoollllee
FFilament
Created by mmoollllee on 2/7/2025 in #❓┊help
Dynamic Form Publish Resource Action
Thank you for your help! I've posted a feature request on Github to see if this might be changed in the future 🙂 https://github.com/filamentphp/filament/discussions/15548
12 replies
FFilament
Created by mmoollllee on 2/7/2025 in #❓┊help
Dynamic Form Publish Resource Action
Thank you for the hints! Now I see the buttons! But so far I'd have to inform the user after click that what he's trying to do does not make sense. I'd just like to build the Actions in a way, that the user can't even go wrong 😉 So I tryed another approach to make the Date-Field ->live() and use ->visible(fn (?Get $get): bool => $get('publishing_begins_at') === null), But that results in Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization So another idea could be to change the Actions from the Field via ->afterStateUpdated()? Is there a chance to access the ActionButtons via Javascript?
12 replies
FFilament
Created by mmoollllee on 2/7/2025 in #❓┊help
Dynamic Form Publish Resource Action
This does not work as $record is null as long as it is not created yet and does not listen to unsaved changes. Is there a way to make this work "live"?
Actions\Action::make('saveAsDraft')
->label('Save as Draft')
->action('saveAsDraft')
->visible(fn (Model $record) => $record->publish_at === null),
Actions\Action::make('saveAndPublish')
->label('Save and Publish')
->action('saveAndPublish')
->visible(fn (Model $record) => $record->publish_at === null || $record->publish_at->isPast()),
Actions\Action::make('saveAndPublishLater')
->label(fn () => 'Save and publish on ' . $this->record->publish_at->format('d-m-Y'))
->action('saveAndPublishLater')
->visible(fn (Model $record) => $record->publish_at->isFuture()),
Actions\Action::make('saveAsDraft')
->label('Save as Draft')
->action('saveAsDraft')
->visible(fn (Model $record) => $record->publish_at === null),
Actions\Action::make('saveAndPublish')
->label('Save and Publish')
->action('saveAndPublish')
->visible(fn (Model $record) => $record->publish_at === null || $record->publish_at->isPast()),
Actions\Action::make('saveAndPublishLater')
->label(fn () => 'Save and publish on ' . $this->record->publish_at->format('d-m-Y'))
->action('saveAndPublishLater')
->visible(fn (Model $record) => $record->publish_at->isFuture()),
12 replies
FFilament
Created by mmoollllee on 2/7/2025 in #❓┊help
Dynamic Form Publish Resource Action
Sure! But can I hide/disable a ActionButton based on field's data?
12 replies
FFilament
Created by mmoollllee on 2/7/2025 in #❓┊help
Dynamic Form Publish Resource Action
True! But it would be nice if the Action-Button's label could change to indicate the resulting action.
12 replies
FFilament
Created by mmoollllee on 1/25/2025 in #❓┊help
Tenancy with other packages Model
And how is tenancy used with other plugins like filament-logger? https://github.com/Z3d0X/filament-logger
2 replies
FFilament
Created by ambonboy. on 1/25/2025 in #❓┊help
Form field value based on 2 other fields
Can you provide a real example with the "other fields" to help you precicely?
7 replies
FFilament
Created by mmoollllee on 1/24/2025 in #❓┊help
set TextInput placeholder attribute live from other field
Thank you so much and sorry for asking altough I could have found this in the documentation!
5 replies