bwubs
bwubs
FFilament
Created by bwubs on 9/9/2024 in #❓┊help
FilePond modal position
This makes sure the modal opens up without positioning constrains 🙂
4 replies
FFilament
Created by bwubs on 9/9/2024 in #❓┊help
FilePond modal position
Huraay! I've fixed it myself by putting the form outside of the header image:
<form wire:submit.prevent="submit" x-cloak
x-on:form-processing-started="isUploadingFile = true"
x-on:form-processing-finished="isUploadingFile = false">

<div class="w-full bg-cover rounded-md bg-center @if($userDto->header_image) h-64 @endif"
@if($userDto->header_image) style="background-image: url('{{ $userDto->header_image }}')" @endif>
</div>
<div class="flex items-center justify-center -mt-24 pb-20">
{{ $this->avatarForm }}
</div>
</form>
<form wire:submit.prevent="submit" x-cloak
x-on:form-processing-started="isUploadingFile = true"
x-on:form-processing-finished="isUploadingFile = false">

<div class="w-full bg-cover rounded-md bg-center @if($userDto->header_image) h-64 @endif"
@if($userDto->header_image) style="background-image: url('{{ $userDto->header_image }}')" @endif>
</div>
<div class="flex items-center justify-center -mt-24 pb-20">
{{ $this->avatarForm }}
</div>
</form>
4 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
and the field contains a cast that turns the string into an object that represents the concept
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
Why? I'ts already being stored in a standard for temporal distance
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
or no offset at all
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
In the end, it all boils down to either an offset in days, weeks or months
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
Depending on the medium of the message, the second row needs to either include the time or not. When the message needs to be sent at the moment of the trigger, there's no need for a time offset. So the second row just needs to be "at [trigger]".
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
I understand. The context is sending a message at, before or after an already selected trigger
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
This value can later be given to CarbonInterval::fromString()
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
The value that is stored is something like "+3 days" or "-4 weeks"
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
The reason i'm working with a custom field that contains multiple inputs is becasue of the editing. Now inside the custom field I can break the value apart in it's indiviual parts and fill the form fields accordingly
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
I'm using standard form builder
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
Here's a screenshot. For every selected radio, the row below needs to change.
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
The form needs to change dynamically based upon selected values. It's too complicated to do with reactive
28 replies
FFilament
Created by bwubs on 7/28/2023 in #❓┊help
One field, multiple inputs
From what I understand after a quick look, this is built on ->reactive() fields. For what it's worth, I'm already working on a solution. What I have so far is this: file moment-offset.blade.php
<div class="col-span-1" x-data="{
state: $wire.{{ $applyStateBindingModifiers('entangle(\'' . $getStatePath() . '\')') }},
count: 0,
unit: 'days',
relation: null,
translations: @json($getTranslations()),
init() {
$watch('relation', (value) => this.state = value+this.count+ ' ' + this.unit)
$watch('count', (value) => this.state = this.relation+value+ ' ' + this.unit)
$watch('unit', (value) => this.state = this.relation+this.count+ ' ' + value)
}

}">
<div>
<div class="grid grid-cols-1 filament-forms-component-container gap-6">
<x-dynamic-component>...</x-dynamic-component>
<x-dynamic-component>...</x-dynamic-component>
</div>
</div>
</div>
<div class="col-span-1" x-data="{
state: $wire.{{ $applyStateBindingModifiers('entangle(\'' . $getStatePath() . '\')') }},
count: 0,
unit: 'days',
relation: null,
translations: @json($getTranslations()),
init() {
$watch('relation', (value) => this.state = value+this.count+ ' ' + this.unit)
$watch('count', (value) => this.state = this.relation+value+ ' ' + this.unit)
$watch('unit', (value) => this.state = this.relation+this.count+ ' ' + value)
}

}">
<div>
<div class="grid grid-cols-1 filament-forms-component-container gap-6">
<x-dynamic-component>...</x-dynamic-component>
<x-dynamic-component>...</x-dynamic-component>
</div>
</div>
</div>
This combines two rows into one field, resulting in one state binding. I don't know if this is the "correct" way of doing this, but it seems to work so far
28 replies
FFilament
Created by TVKVDS on 6/26/2023 in #❓┊help
Log Action events
I'm continuing the conversation on another account (I asked this while pairing with a colleague). I think you are right, I've made a wrong assumption on how the code works. Diving deeper shows that it should indeed work
4 replies
FFilament
Created by bwubs on 6/20/2023 in #❓┊help
MorphToSelect with one type
Good point
20 replies
FFilament
Created by bwubs on 6/20/2023 in #❓┊help
MorphToSelect with one type
This is the complete code now:
private function getLocationField(): array
{
return [
Select::make('subject_id')->label(__('Location'))
->options(Location::query()->select(['id', 'name'])->get()->mapWithKeys(fn(Location $location) => [$location->id => $location->name]))
->visible(fn($get) => $get('type') === LocationTask::getName()),

Hidden::make('subject_type')->default((new Location())->getMorphClass())
];
}
private function getLocationField(): array
{
return [
Select::make('subject_id')->label(__('Location'))
->options(Location::query()->select(['id', 'name'])->get()->mapWithKeys(fn(Location $location) => [$location->id => $location->name]))
->visible(fn($get) => $get('type') === LocationTask::getName()),

Hidden::make('subject_type')->default((new Location())->getMorphClass())
];
}
It works great tothether with the hidden input
20 replies
FFilament
Created by bwubs on 6/20/2023 in #❓┊help
MorphToSelect with one type
Yes, this seems to work!
20 replies