GavTheDev
GavTheDev
FFilament
Created by GavTheDev on 6/27/2024 in #❓┊help
Plugin count on filamentphp.com always off by 2
The underlined total shows 271 but the actual total is 269. It's been like this I think forever so maybe @teamfilament haven't noticed (can't imagine! :)) @Dan Harrin
3 replies
FFilament
Created by GavTheDev on 5/4/2024 in #❓┊help
Wizard: different steps based on value in step 1
I'm trying to create a wizard where the first step is choosing an option, and based on that option the next step shows the form for that type. Is there an easy way to achieve that? One option is to just set steps visible/hidden, but is that the best way?
7 replies
FFilament
Created by GavTheDev on 4/28/2024 in #❓┊help
Select HasMany relationship with CreateOption
According to the docs the ability to create a new option on the fly only supports BelongsTo and BelongsToMany relations, but my use-case is a HasMany. I have been experimenting but nothing seems to work unfortunately. How can I get a HasMany to work? What I am trying to achieve is a checkout form where an authed user can select a shipping address, and if it does not exist they could create one on the fly.
Select::make('addresses')
->label(__('Shipping Address'))
->relationship(
name: 'auth.user.addresses', // Tried 'addresses`, 'user.addresses`, 'auth.user.addresses`,
titleAttribute: 'addres_line'
)
->preload()
->searchable(false)
->createOptionForm([
TextInput::make('line_one')
->required(),
])
Select::make('addresses')
->label(__('Shipping Address'))
->relationship(
name: 'auth.user.addresses', // Tried 'addresses`, 'user.addresses`, 'auth.user.addresses`,
titleAttribute: 'addres_line'
)
->preload()
->searchable(false)
->createOptionForm([
TextInput::make('line_one')
->required(),
])
2 replies
FFilament
Created by GavTheDev on 4/12/2024 in #❓┊help
Use another column in the url for ID
I have a separate panel for sellers and I want to get orders by their reference ('FGIBNTSC02HD') instead of their ID ('123'). Can I set this on Filament level? I know I can set it on model level but that's not what I'm looking for. I just want it for this particular panel.
8 replies
FFilament
Created by GavTheDev on 4/1/2024 in #❓┊help
Adding a toggle to a section, where to begin?
I would like to add a toggle to a section header, and when toggled true/on the section is opened (basically the same functionality as collapsible). However, the form content of the section should not be dehydrated when it's collapsed/closed. Where do I begin? How do I signal to the content that it should somehow be ignored when collapsed, and how do I replace the caret with a toggle and that it still works? Could use some pointers!
2 replies
FFilament
Created by GavTheDev on 4/1/2024 in #❓┊help
Toggle in section heading
Would it be possible to add a toggle (or checkbox) to a section, and when toggled the content is included in the form when posted, otherwise not?
2 replies
FFilament
Created by GavTheDev on 3/20/2024 in #❓┊help
Only one primary row when toggled in table
I'm looking to add a toggle or radio to a table (not in panel) that allows only one value to be selected. If another value is toggled, that one becomes primary and the other ones are deselected. I'm pretty sure I've seen it somewhere but now I cannot find it 😕
5 replies
FFilament
Created by GavTheDev on 3/9/2024 in #❓┊help
Togglebuttons multiple() selects all
I'm just using the sample code from the docs and for some reason all buttons are being selected when you click just one. Anyone else experienced this?
ToggleButtons::make('technologies')
->multiple()
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
])
ToggleButtons::make('technologies')
->multiple()
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
])
3 replies
FFilament
Created by GavTheDev on 2/24/2024 in #❓┊help
Builder blockpicker icon not possibe to set?
We can set the label for a Builder blockpicker, but it looks there's no option to set an icon? I also tried to use new HtmlString but that does not seem to work (tags are not converted). Is it correct it's not possible set an icon? Or customize the picker entirely?
2 replies
FFilament
Created by GavTheDev on 2/20/2024 in #❓┊help
Switch between 2 types of sellers in same panel?
I'm looking to recreate similar functionality to Fiverr's seller and buyer profiles, if anyone's familiar with that. I don't have sellers and buyers, but rather 2 types of sellers (designers and manufacturers), and I would like users to be able to switch between them, using the same user account. For this I have created a seller panel in my app. I currently have a designer navigationGroup, and a manufacturer navigationGroup, but there is, or seems to be, no way of conditionally hiding/showing navigationGroups. A designer should see only the designer navigationGroup, a manufacturer only the manufacturer navigationGroup. But it's also possible that they are both, so a seller should see both navigationGroups. How can I conditionally load different resources/pages for different types of sellers? I guess I could create 2 separate panels, but they should share user login information, and I'm not sure this is possible. Could use some ideas 😅
4 replies
FFilament
Created by GavTheDev on 2/19/2024 in #❓┊help
Switch between seller and buyer
Has onyone made something to switch between seller and buyer dashboard? Can someone point me in the right direction of how to create something similar?
4 replies
FFilament
Created by GavTheDev on 2/19/2024 in #❓┊help
Edit belongs to many pivot data from edit profile page
I'm looking to edit pivot data from a custom edit profile page. I can't use a relationmanager because it's a page with a form and not a resource. How can I achieve this?
2 replies
FFilament
Created by GavTheDev on 12/8/2023 in #❓┊help
Radio button to select only one record on a relationmanager table
You can use a toggle or checkbox to set the boolean state of a relationmanager record, but these make it possible to select more than one. I'm looking for something similar, but as radio buttons which will only let you select one option. Would this be possible with filament?
2 replies
FFilament
Created by GavTheDev on 11/25/2023 in #❓┊help
Update attribute outside of form
Is it possible to update an attribute outside a form on afterStateUpdated()? I can update any field in the form with $set(), but can you do it with other attributes that are not part of the form?
6 replies
FFilament
Created by GavTheDev on 9/25/2023 in #❓┊help
Spatie Media Library in Builder
I've added SpatieMediaLibraryFileUpload as a content block to a Builder field, and while the upload is successfully completed (it's inserted into the media database), there is nothing being stored in the blocks json. Meaning, the block is inserted, but there's nothing in data. How do you implement the uploader properly to get at least a reference to the media records (in order to be able to print them to screen)? Is that even possible?
4 replies
FFilament
Created by GavTheDev on 8/13/2023 in #❓┊help
Confused about multiple dashboards
According to the docs any page you add to App/Filament/Pages that extends Filament\Pages\Dashboard will be available as a new dashboard. However, whatever I add breaks the admin with Route [filament.admin.pages.dashboard-one] not defined.. I tried adding the pages explicitly to $panel->pages() but the error remains. What am I missing?
16 replies
FFilament
Created by GavTheDev on 6/26/2023 in #❓┊help
Spatie Settings together with Translatable
Can this work together? If so, how to implement? I've been looking at how it's done in for instance EditRecord, but no luck yet 😦
5 replies
FFilament
Created by GavTheDev on 5/31/2023 in #❓┊help
Add a letter navigation bar on list page
I'm looking to add some filtering on the first letter of a record's title. I can add a dropdown to the filters but I prefer to have it always available above the table as A-Z buttons. What would be a good approach? Or where should I look for inspiration? I'm just looking for some pointers in the right direction 🤓
21 replies
FFilament
Created by GavTheDev on 5/24/2023 in #❓┊help
Search input per table column
I'm pretty sure I saw this somewhere recently but can't find it in the docs or in plugins. Where do I need to look for this?
3 replies
FFilament
Created by GavTheDev on 5/24/2023 in #❓┊help
How to access the $search variable in recordSelectOptionsQuery() on RelationManager
I'd like to search another column ('meaning') as well when attaching a record, but how do I access the search variable? This is not working:
Tables\Actions\AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query, $search) => $query->orWhere('meaning', 'like', "%{$search}%"))
->recordTitle(fn (Model $record) => "{$record->text}\n- {$record->meaning}"),
Tables\Actions\AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query, $search) => $query->orWhere('meaning', 'like', "%{$search}%"))
->recordTitle(fn (Model $record) => "{$record->text}\n- {$record->meaning}"),
3 replies