Oliverdam
Oliverdam
FFilament
Created by Oliverdam on 5/21/2024 in #❓┊help
Relationship manager doesn't show up on edit page
I have created a relationship manager, for a HasMany relationship, with the command from the docs and added it to the resource. However the table that should be on the edit page doesn't show up. This is especially weird, because we already have relationship managers for different hasMany relationships, that work without issues. There are no errors coming from the backend nor in the browser console. I have tested the model relationship both ways and they work. When I dump inside the models relationship function, I can see that it's being called, but no queries related to the table are run. I can also see that by the code throwing an error if I change $relationship to a non-existing function. The table function in the relationship manager is not being called at any point. I have tried reinstalling and updating all dependencies. Sorry if there's something obvious I have missed, but I'm at my wits' end.
8 replies
FFilament
Created by Oliverdam on 9/12/2023 in #❓┊help
Triggering state change
I'm trying to create a custom component that's a block editor, using the Laraberg library (https://github.com/VanOns/laraberg). The laraberg editor gets initialized from a textfield, this textfields value is then updated on submit. The value does get updated, but it doesn't seem to update the state, meaning null gets sent to the backend. This is the code for the component I have right now.
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div x-data="{ state: $wire.$entangle('{{ $getStatePath() }}') }"
x-cloak
wire:ignore
x-init="$nextTick(() => {
Laraberg.init('laraberg-input', { laravelFilemanager: true, height: '800px' });
})"
>
<textarea id="laraberg-input" name="laraberg-body"x-model="state"></textarea>
</div>
</x-dynamic-component>
<x-dynamic-component
:component="$getFieldWrapperView()"
:field="$field"
>
<div x-data="{ state: $wire.$entangle('{{ $getStatePath() }}') }"
x-cloak
wire:ignore
x-init="$nextTick(() => {
Laraberg.init('laraberg-input', { laravelFilemanager: true, height: '800px' });
})"
>
<textarea id="laraberg-input" name="laraberg-body"x-model="state"></textarea>
</div>
</x-dynamic-component>
18 replies
FFilament
Created by Oliverdam on 9/11/2023 in #❓┊help
Initialize custom form component
I have a custom component that has a script for initializing the field, setting up the DOM for the field. I want this field to be hidden by default, but I noticed it's not present in the DOM before it becomes visible. Is there a way to either call the javascript function when it becomes visible, or have the field be present in the DOM?
6 replies
FFilament
Created by Oliverdam on 9/5/2023 in #❓┊help
Modify the state of a repeater when an item is added
In v2 I had set up a listener to listen on the repeater::createItem event, but I can see that the repeaters are no longer using events in v3. I tried adding something like
->addAction(fn (Action $action) => $action->dispatch('createItem'))
->addAction(fn (Action $action) => $action->dispatch('createItem'))
to the repeater and the listen on this event instead, but that doesn't seem to work. I'm guessing I can override the action, doing exactly the same as what is done in the Repeater class, and tacking my code on at the end. I'd like to avoid this thought, as that just seems wrong and if there is a change the repeater action I'll have to update this as well. Can someone point me in the direction of how this could be achieved.
13 replies