Abi
Abi
Explore posts from servers
FFilament
Created by Abi on 8/6/2024 in #❓┊help
Cannot get custom Validation Message for Select Component to work
No description
15 replies
FFilament
Created by Abi on 8/2/2024 in #❓┊help
Split Layout Grows with growing field size. How to fix?
No description
2 replies
FFilament
Created by Abi on 5/9/2024 in #❓┊help
Question regarding navigation groups
1. Is there a way to set an icon for navigation groups. 2. How do I order navigation groups in a specific order?
1 replies
FFilament
Created by Abi on 5/8/2024 in #❓┊help
Component not found after Standalone Form Submission
I create a Standalone Filament Form inside a Livewire Component. I am only able to submit the form for the first time, the next time I click the submit button, I get a javascript error livewire.esm.js:8341 Uncaught Component not found: CmxiE7XWv7BNlojJe6Z5. Has someone faced a similar issue? What could be causing it?
22 replies
FFilament
Created by Abi on 5/6/2024 in #❓┊help
Modify query for Select Element on form with relationship based on another form element
I have 2 Select components on the form. Item Category and Vendor. both these fields have belongsToMany relationship with a pivot table category_vendor that stores vendors for each category or categories for a vendor. When a user selects a category, I want to display a list of vendors for that category and I am trying to use the modifyQueryUsing parameter for the relationship method on the vendor field. How do I pass the selected category to the vendor fields query parameter?
Select::make('item_category_id')
->relationship('itemCategory', 'name')
->createOptionAction(fn (Action $action) => $action->modalWidth('sm'))
->createOptionForm([
TextInput::make('name')
->label('Name')
->required(),
])
->preload()
->columnSpanFull()
->searchable()
->live()
->required(),

Select::make('vendor_id')
->relationship('vendor', 'name', fn ($query) => $query->whereHas('categories', '?')),
Select::make('item_category_id')
->relationship('itemCategory', 'name')
->createOptionAction(fn (Action $action) => $action->modalWidth('sm'))
->createOptionForm([
TextInput::make('name')
->label('Name')
->required(),
])
->preload()
->columnSpanFull()
->searchable()
->live()
->required(),

Select::make('vendor_id')
->relationship('vendor', 'name', fn ($query) => $query->whereHas('categories', '?')),
2 replies
FFilament
Created by Abi on 4/25/2024 in #❓┊help
Move Modal's Create Action to Wizard Submit Action
I have a resource that uses the Modal to create, the resource's form uses a Wizard and I want to move the Create Action of the Modal inside the Wizard as the Submit Action for the last step of the Wizard. How do I do this?
9 replies
FFilament
Created by Abi on 4/23/2024 in #❓┊help
Multi Tenancy associate Tenant to Resource
I have created a model that has a team_id column and also a team() relation to the Team model. The Team model has been setup as the tenant model on the Provider.
//AdminPanelProvider.php
$panel->tenant(model: Team::class, slugAttribute: 'slug', ownershipRelationship: 'team')
//AdminPanelProvider.php
$panel->tenant(model: Team::class, slugAttribute: 'slug', ownershipRelationship: 'team')
Do I need to do anything else in each resource to associate the tenant id for the CRUD operations? I get this error when I create a new record on a resource inside the Multi Tenancy Panel
SQLSTATE[HY000]: General error: 1364 Field 'team_id' doesn't have a default value
SQLSTATE[HY000]: General error: 1364 Field 'team_id' doesn't have a default value
Any advice?
6 replies
FFilament
Created by Abi on 4/22/2024 in #❓┊help
Is it possible to specify the scope of render hooks to a Panel?
I have 2 filament panels in my app and I want to set the render hook only to a specific panel. How can I do this?
5 replies
FFilament
Created by Abi on 4/22/2024 in #❓┊help
Setting the default page for Multi-Tenancy
After a user registers and creates a tenant, the user is automatically redirected to /{panel-path}/{id}, but I get a 404 | Not Found error. How do I set what the default page should be loaded after a user logs in?
1 replies
FFilament
Created by Abi on 4/22/2024 in #❓┊help
Is it possible to replace the color gray to zinc when using dark mode?
Is it possible to replace the color gray to zinc when using dark mode on the Filament Panels?
9 replies
FFilament
Created by Abi on 4/16/2024 in #❓┊help
Updating Standalone Action's modal description based on the argument passed to the form
I have a standalone action that launches a modal. I want to update the modal description based on the argument passed to the Form?
Action::make('addToCart')
->label('ADD PLAYERS TO CART')
->modalDescription(new HtmlString('Some Description goes here.'))
->modalWidth('2xl')
->modalSubmitActionLabel('Add Player to Cart')
->modalFooterActionsAlignment('end')
->form(function ($arguments) {
// Update the Modal Description from here.
})
Action::make('addToCart')
->label('ADD PLAYERS TO CART')
->modalDescription(new HtmlString('Some Description goes here.'))
->modalWidth('2xl')
->modalSubmitActionLabel('Add Player to Cart')
->modalFooterActionsAlignment('end')
->form(function ($arguments) {
// Update the Modal Description from here.
})
6 replies
FFilament
Created by Abi on 3/30/2024 in #❓┊help
Livewire is not defined
When inject_assets is set to false on the livewire.php config, I get the error Livewire is not defined when loading the filament admin panel. What needs to be done to fix this?
5 replies
FFilament
Created by Abi on 3/28/2024 in #❓┊help
How can I show an icon as the label for a Table Builder column
I want to show an image or a blade icon as the label for a Table Builder column. Is there any way to do this? I am using an Icon Column and here is what I have tried so far:
Tables\Columns\IconColumn::make('email_verified')
->label(fn()=> Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />'))
->alignCenter()
->tooltip(fn ($record) => $record->email_verified_at ? 'Email Verified' : 'Email Not Verified')
->getStateUsing(fn ($record) => isset($record->email_verified_at))
->boolean(),
Tables\Columns\IconColumn::make('email_verified')
->label(fn()=> Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />'))
->alignCenter()
->tooltip(fn ($record) => $record->email_verified_at ? 'Email Verified' : 'Email Not Verified')
->getStateUsing(fn ($record) => isset($record->email_verified_at))
->boolean(),
3 replies
FFilament
Created by Abi on 3/27/2024 in #❓┊help
Is there a method to disable `iconButton` on an Action
One of the filament packages set's up by default as an IconButton on the setUp method of its Action class. I want to disable it. I am trying to add this action to an Action group but not able to disable it rendering as an iconButton on the ActionGroup.
4 replies
FFilament
Created by Abi on 3/26/2024 in #❓┊help
Issue accessing `$record` within the `hidden()` method on TextColumn
The $record object when used on the closure of the hidden() method is null. Any reason why this would happen?
13 replies
FFilament
Created by Abi on 3/17/2024 in #❓┊help
How do I go about aligning the widgets on a custom dashboard?
No description
12 replies
FFilament
Created by Abi on 3/16/2024 in #❓┊help
setting a custom homeUrl after login doesn't seem to work
i have a new panel created and set the homeUrl('calendar') but everytime I login on the new panel, it tries to look for dashboard
12 replies
FFilament
Created by Abi on 3/12/2024 in #❓┊help
Adding close button when customizing modalFooterActions
On the Table action, when we need to add multiple Action buttons, we use the modalFooterActions() method to add more actions. Is there a way to add an action called "Close" that can close the modal just list the default footer actions?
2 replies
FFilament
Created by Abi on 3/12/2024 in #❓┊help
Change the color of the Submit button on the Table Action Modal
No description
10 replies
FFilament
Created by Abi on 3/7/2024 in #❓┊help
dispatch livewire event after action execution
is there a way to dispatch a livewire event after creation of a record using the CreateAction or any other Inbuilt actions? I saw there is an event afterFormValidated but that wouldn't signify data creation
7 replies