charliefortune
charliefortune
FFilament
Created by charliefortune on 3/1/2024 in #❓┊help
Is it possible to extend RichEditor?
How would I start extending the RichEditor - to add a couple of new buttons, such alignment for example.
2 replies
FFilament
Created by charliefortune on 2/29/2024 in #❓┊help
Add styles to RichEditor images
Is there a way to add styles to images added into a RichEditor? I don't want to do much - perhaps add one of a small selection of classes or an inline max-width, and control the alignment. Right now, images float to the left and there doesn't seem to be any way to control their positioning on the row or their style. And using the </> button doesn't open up a source code view at all.
2 replies
FFilament
Created by charliefortune on 12/7/2023 in #❓┊help
Can I listen for blur/onchange type events for a form field component?
I'm trying to disable fields (and show a spinner) on blur, then re-enable (and mark as completed )after the state has been updated and the field rehydrated. Is there a lifecycle hook I can use for this?
aferStateUpdated()
aferStateUpdated()
doesn't invoke my closure until the network request has completed, so there's too much of a delay.
2 replies
FFilament
Created by charliefortune on 11/28/2023 in #❓┊help
Is it possible to remove headers from repeater rows?
Has anyone found a way to remove the headings/form field labels from repeater rows, other than for simple repeaters with a single field? I onlyt have 3 fields and it's ugly and bulky with headers and container each time.
5 replies
FFilament
Created by charliefortune on 10/4/2023 in #❓┊help
What's the best way to store S3 image URI to work with the file upload field?
For my file upload field to render a thumbnail of a previously stored image, how should I be storing the file URI? A full endpoint type path (e.g. http://example.s3-website.eu-west-2.amazonaws.com/image/file/Screen_Shot_2019-03-20_at_11_57_05.png) or a relative path (e.g. image/file/Screen_Shot_2019-03-20_at_11_57_05.png) ? The resources are private, so will need presigned urls' - I assume the visibility method can take care of this? My form field component looks like this;
FileUpload::make('logo_path')
->label('Logo')
->disk('s3')
->visibility('private')
->image();
FileUpload::make('logo_path')
->label('Logo')
->disk('s3')
->visibility('private')
->image();
22 replies
FFilament
Created by charliefortune on 9/6/2023 in #❓┊help
How can I get the ID of the deleted item in a repeater action?
I can't work out how to get the ID of the deleted item in the delete action that is attached to my repeater. The $state parameter has the entire state of the repeater (e.g. all items), have I attached my action to the wrong component perhaps? Code looks like this... ```Repeater::make('eventQuestionnaires') ->label(__('Questionnaires')) ->relationship() ->deleteAction( function (Action $action) { $action->requiresConfirmation() ->action(function(Repeater $component, callable $get, $state){ ray($component); ray($state); }) ->modalSubmitActionLabel('Remove'); }, ) ->schema([
17 replies
FFilament
Created by charliefortune on 9/4/2023 in #❓┊help
How do I reload a repeater item after one of its fields have been updated?
I have a repeater in my form to add questionnaires to an event. Newly added items don't get persisted until one of the fields in the row is updated. Upon update, a round trip is made to the api of the remote data store and the record is created, and returned. This in turn is then added to the local database, and is working as expected. My problem is now injecting the record ID (and any other properties that might have come back from the api request) into the repeater item. Should I be reloading the relationship manually or refreshing the component? Or is this a sign that my model isn't correctly bound to the component? Code to follow...
4 replies
FFilament
Created by charliefortune on 8/31/2023 in #❓┊help
Populate a date in a repeater item from its preceding sibling?
I want to set a default value for the date field in each new repeater item, so it is matches the date of the previous item. I've tried using the
default()
default()
method on the field, with a
$get
$get
closure, but I can seem to get any data out of the
$get
$get
call. Is this the wrong approach?
->schema([
DatePicker::make('date')
->label(__('Date'))
->lazy()
->default(fn (Closure $get) => $get('../../date')
->required(),
TimePicker::make('start_time')
->label(__('Start Time'))
->lazy()
->default('09:00'),
TimePicker::make('end_time')
->label(__('End Time'))
->lazy()
->default('17:00'),
])
->columns(3),
->schema([
DatePicker::make('date')
->label(__('Date'))
->lazy()
->default(fn (Closure $get) => $get('../../date')
->required(),
TimePicker::make('start_time')
->label(__('Start Time'))
->lazy()
->default('09:00'),
TimePicker::make('end_time')
->label(__('End Time'))
->lazy()
->default('17:00'),
])
->columns(3),
2 replies
FFilament
Created by charliefortune on 8/21/2023 in #❓┊help
How do I get the values of the latest item in a repeater?
2 replies
FFilament
Created by charliefortune on 7/21/2023 in #❓┊help
Convert Eloquent relationship to query builder for table?
Is it possible to use Eloquent relationships in the getTableQuery() method of the table builder? I want to do this because I have all of the relationships I want to use built as relationships, so rewriting them as queries seems like duplication. I also realise that I could use query scopes - but this also feels like duplication, as I wouldn't need the scopes anywhere else. I understand the table builder needs a query builder though - so I wondered if there was a way to convert something like a HasMany to an Eloquent query builder so I can use it in this way.
3 replies