Jon Mason
Jon Mason
FFilament
Created by Jon Mason on 2/8/2025 in #❓┊help
Help with custom field
I was able to do this and at least get the ID on the input to match the absolute state path, so it's no longer just like my-field, now it's mountedTableActionsData.0.lines.my-field
@php
$extraAlpineAttributes = $getExtraAlpineAttributes();
$prefixLabel = $getPrefixLabel();
$isDisabled = $isDisabled();
$id = $getId();
@endphp

<x-dynamic-component :component="$getFieldWrapperView()" :field="$field">

<div x-data="{
state: $wire.entangle('{{ $getStatePath(true) }}'),
updateState() {
this.$wire.set('{{ $getStatePath(true) }}', this.state);
}
}">
<x-filament::input.wrapper :prefix="$prefixLabel" :disabled="$isDisabled">
<x-filament::input type="text" x-model="state" @blur="updateState" :attributes="\Filament\Support\prepare_inherited_attributes($getExtraInputAttributeBag())
->merge($extraAlpineAttributes, escape: false)
->merge([
'disabled' => $isDisabled,
'id' => $id,
])" />
</x-filament::input.wrapper>
</div>
</x-dynamic-component>
@php
$extraAlpineAttributes = $getExtraAlpineAttributes();
$prefixLabel = $getPrefixLabel();
$isDisabled = $isDisabled();
$id = $getId();
@endphp

<x-dynamic-component :component="$getFieldWrapperView()" :field="$field">

<div x-data="{
state: $wire.entangle('{{ $getStatePath(true) }}'),
updateState() {
this.$wire.set('{{ $getStatePath(true) }}', this.state);
}
}">
<x-filament::input.wrapper :prefix="$prefixLabel" :disabled="$isDisabled">
<x-filament::input type="text" x-model="state" @blur="updateState" :attributes="\Filament\Support\prepare_inherited_attributes($getExtraInputAttributeBag())
->merge($extraAlpineAttributes, escape: false)
->merge([
'disabled' => $isDisabled,
'id' => $id,
])" />
</x-filament::input.wrapper>
</div>
</x-dynamic-component>
I think it's a step in the right direction, but it didn't resolve the issue.
4 replies
FFilament
Created by Jon Mason on 2/8/2025 in #❓┊help
Help with custom field
it has something to do with $getStatePath(), and I think I need to somehow use absoluteStatePath instead.
4 replies
FFilament
Created by Jon Mason on 2/7/2025 in #❓┊help
Persisting repeater changes to DB (TableRepeter)
turns out I am dumb. I didn't realize that $get() would work on data that's not an actual field. The ID of my row isn't an input field...I just tried it on a whim and it returns my id, so I learned something new today.
3 replies
FFilament
Created by Jon Mason on 2/6/2025 in #❓┊help
repeater deleteAction get deleted record to handle it?
This gets me what I need:
$action->before(function (array $arguments, \Filament\Forms\Components\Repeater $component, Get $get, Set $set) {

dd($component->getRawItemState($arguments['item']));
$action->before(function (array $arguments, \Filament\Forms\Components\Repeater $component, Get $get, Set $set) {

dd($component->getRawItemState($arguments['item']));
3 replies
FFilament
Created by Jon Mason on 1/27/2025 in #❓┊help
form with multiple fields using the same model property
I've tried wrapping an extra array around it as well, but no joy:
->fillForm(function (AutomatedSalesJournalEntryHeader $record) {
$lines = $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {
return [
'account_ref_id' => $line->account_ref_id,
'debits' => $line->amount,
'credits' => $line->amount,
'description' => $line->description,
];
})->toArray();
// dd($lines);
return ['lines' => $lines];
})
->fillForm(function (AutomatedSalesJournalEntryHeader $record) {
$lines = $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {
return [
'account_ref_id' => $line->account_ref_id,
'debits' => $line->amount,
'credits' => $line->amount,
'description' => $line->description,
];
})->toArray();
// dd($lines);
return ['lines' => $lines];
})
4 replies
FFilament
Created by Jon Mason on 1/27/2025 in #❓┊help
form with multiple fields using the same model property
I should mention that the other fields are populating in the form, just not the one I'm trying to use twice.
4 replies
FFilament
Created by Jon Mason on 1/27/2025 in #❓┊help
TableRepeater / Repeater populating form
Thanks!
10 replies
FFilament
Created by Jon Mason on 1/27/2025 in #❓┊help
TableRepeater / Repeater populating form
ok, that's helpful. It didn't work with fillFormUsing, but there's a fillForm method and that worked!
->fillForm(function (AutomatedSalesJournalEntryHeader $record) {
return [
'lines' => $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {
return [
'account_ref_id' => $line->account_ref_id,
'amount' => $line->amount,
'description' => $line->description,
];
})->toArray(),
];
})
->fillForm(function (AutomatedSalesJournalEntryHeader $record) {
return [
'lines' => $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {
return [
'account_ref_id' => $line->account_ref_id,
'amount' => $line->amount,
'description' => $line->description,
];
})->toArray(),
];
})
10 replies
FFilament
Created by Jon Mason on 1/27/2025 in #❓┊help
TableRepeater / Repeater populating form
it is
10 replies
FFilament
Created by rubendn on 12/19/2024 in #❓┊help
Using Flux UI on Custom Page
@rubendn Following up on this to see if you've seen any issues going this route? I'm interested in plugging in flux to use it in a couple of places and was curious what your experience has been so far? I mainly have a unique use-case where I need a searchable select blade component, and I know flux has a searchable select, so wondering if this would be pretty easy to incorporate or if you've run into headaches.
6 replies
FFilament
Created by Jon Mason on 11/9/2023 in #❓┊help
Argument must be of type string, null given, in action on infolist component
I don't think so, I believe I just went a different direction.
36 replies
FFilament
Created by Jon Mason on 3/16/2024 in #❓┊help
Uncaught (in promise) Component not found
no unfortunately I'm still trying to resolve it.
5 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
For some reason, this seems to fix the remaining issues: protected static ?string $navigationLabel = 'Month End Dashboard';
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
it has to be something about this:
->discoverWidgets(in: app_path('Filament/App/Widgets'), for: 'App\\Filament\\App\\Widgets')
->widgets([
])
->discoverWidgets(in: app_path('Filament/App/Widgets'), for: 'App\\Filament\\App\\Widgets')
->widgets([
])
But I just get different errors if I remove any of that..
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
I added a getWidgets method to each class so I could get the right widgets included on each dashboard. Now, despite having fully gutted my new Dashboard class, and having getWidgets() return an empty array, it's still returning the widget.
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
ok I was able to fix that with: protected static string $routePath = '/'; in my MonthEndDashboard class. Now I'm getting a different error in my widget class...oof.
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
->pages([
Dashboard::class,
MonthEndDashboard::class,
])
->pages([
Dashboard::class,
MonthEndDashboard::class,
])
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
I switched everything back to where I have 2 pages that extend \Filament\Pages\Dashboard, and now i'm getting Route [filament.app.pages.dashboard] not defined.
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
oh wait I just remembered about the discoverWidgets method...so I've gotta figure out how to make it not find the widgets for the old dashboard when you navigate to the new one.
15 replies
FFilament
Created by Jon Mason on 10/2/2024 in #❓┊help
multiple dashboards
ok, so I didn't do a good job explaining what I was trying to do, I was running into an issue with the first step, but didn't describe the end goal. I have a class I've been using for the dashboard. It needs to stay like a dashboard, but I need to move it, and have it not be the main page anymore, and I need to create a new dashboard. So I moved the old one to the pages directory and tried to make it extend the Page class, which I was able to do by adding a couple of methods., and copying the markup from the stock dashboard view. So I've almost got everything at this point, the old dashboard functions like I intend it to when I navigate to that page, but the new dashboard that's supposed to replace it as the true dashboard for the panel doesn't work. It's trying to access the widgets from the old dashboard. I feel like I've fixed all the references and anything that would cause it to do that.
15 replies