Martin Lakrids
Martin Lakrids
FFilament
Created by Martin Lakrids on 8/26/2024 in #❓┊help
Sub-navigation hidden on mobile - how to display it instead?
No description
2 replies
FFilament
Created by Martin Lakrids on 8/22/2024 in #❓┊help
Mark a location on an image of a parent resource
I have a “House” model with a title and an image (blueprint). The “House” HasMany “Problem” and I have a relation manager to create these on the House resource. I would like to mark the problem location on the image from the House. Any ideas how to go about doing this? I feel stuck on these two issues: 1: how to access the parent (“House”) in the RelationManager create popup 2: does anyone know of an input that can help me “mark” a location on an image?
3 replies
FFilament
Created by Martin Lakrids on 7/2/2024 in #❓┊help
Refresh hint visibility after $set()
No description
5 replies
FFilament
Created by Martin Lakrids on 6/17/2024 in #❓┊help
TextInput get disabled state in placeholder callback?
How can I access the disabled state from the placeholder callback? To avoid repetition
TextInput::make('title')
->disabled(fn (Get $get) => someIntenseCalculation($get('someOtherField')))
->placeholder(fn ($getDisabledStateSomehow) => $getDisabledStateSomehow ? 'Field disabled' : 'Enter title')
TextInput::make('title')
->disabled(fn (Get $get) => someIntenseCalculation($get('someOtherField')))
->placeholder(fn ($getDisabledStateSomehow) => $getDisabledStateSomehow ? 'Field disabled' : 'Enter title')
4 replies
FFilament
Created by Martin Lakrids on 6/12/2024 in #❓┊help
Add Relation Manager to EditTenantProfile
No description
4 replies
FFilament
Created by Martin Lakrids on 5/1/2024 in #❓┊help
Filter/scope table data based on a PHP function, not using QueryBuilder based on values in database
Is it possible to filter/scope data in a table, based on some computed values that are not stored in the database? Hypothetical example: A list of users, but only show users that passes a filter function. I can only find filter/scope examples what uses the Query Builder, not anything based on some PHP code running after the query builder but before adding it to the table.
11 replies
FFilament
Created by Martin Lakrids on 4/19/2024 in #❓┊help
Am I the only one who often lands on V2 Documentation pages?
Very often when using the Documentation Search bar (by Algolia) or hitting a Google result, I end on the v2 documentation page without noticing. Could you add a warning banner og some other color for the older documentation pages?
8 replies
FFilament
Created by Martin Lakrids on 4/18/2024 in #❓┊help
Table with a modal action that should contain a custom table-like form, is that even possible?
I have a table showing users, with an Action that opens a modal. I want the modal to contain a list of items that can be checked row-by-row, as well a comment field for each row, and a save button. The list of items are NOT Eloquent models, but something that is calculated on the User model. Let's say it is Family members (But again, NOT a Eloquent model yet) and each row should be able to toggle an on/off as well as a comment. I have added the modal with a custom view, where I can loop through the items, but I cannot figure out how to correctly add the form elements (checkboxes and input fields), as well as how do I receive the data in the Component? (I have lots of experience with Laravel, but almost none with Livewire and Filament) The code that generates the table with the action
$table
->query(
...
)
->columns([
...
])
->actions([
Action::make('openmodal')
->modalContent(fn($record): View => view(
'filament.pages.actions.user-modal', [ 'user' => $record, ],
))
)
$table
->query(
...
)
->columns([
...
])
->actions([
Action::make('openmodal')
->modalContent(fn($record): View => view(
'filament.pages.actions.user-modal', [ 'user' => $record, ],
))
)
Some of the code in the modal:
@foreach($user->familyMembers as $item)
<tr>
<td class="text-center">
<x-filament::input.checkbox class="p-3"/> <!-- How to name this "for each family member"? -->
</td>
<td class="text-center">
<x-filament::input class="p-3"/> <!-- How to name this "for each family member"? -->
</td>
...
</tr>

<!-- At the bottom i would like one last input field and a submit button -->

@foreach($user->familyMembers as $item)
<tr>
<td class="text-center">
<x-filament::input.checkbox class="p-3"/> <!-- How to name this "for each family member"? -->
</td>
<td class="text-center">
<x-filament::input class="p-3"/> <!-- How to name this "for each family member"? -->
</td>
...
</tr>

<!-- At the bottom i would like one last input field and a submit button -->

3 replies
FFilament
Created by Martin Lakrids on 10/31/2023 in #❓┊help
Add a widget for every database row of a model on the Dashboard?
No description
3 replies