Dave Mack
Dave Mack
FFilament
Created by Dave Mack on 2/3/2024 in #❓┊help
Exports - but without column selection options
I feel that I am missing something. I am successfully using the Export Action on my Filament Table resource, however I do not want to give my users the option to select columns on and off - ideally, I just want the exporter to export the predefined columns without a further prompt. Is this able to be done with the existing Export action or will I need to create my own exporter for this? If I need to create my own, I struggled to see how I can maintain the current filters that are applied on the table - when I tried this, it would only use the entire unfiltered table data. I’d love to get some advice on this.
3 replies
FFilament
Created by Dave Mack on 9/27/2023 in #❓┊help
Linking Between Table Views with a Filter Value
I am relatively new to Filament. I am wanting to create an action that will link from one Table Resource to another in filament, but I want to pass through a filter value in the link so the 2nd table resource is only showing the records that I want shown based on the filter I pass through. I can't see anywhere in the documentation about this.
18 replies
FFilament
Created by Dave Mack on 8/23/2023 in #❓┊help
Form in Livewire component not displaying grid
Below is the form I am trying to render, but the form is not honouring the grid columns. The form is rendering all the fields vertically as full width inputs. When I use the same structure in the admin panel, it renders as expected, but not in a frontend livewire component. Any ideas?
public function form(Form $form): Form
{
return $form
->schema([
Section::make()->schema([
Grid::make()->columns(2)->schema([
TextInput::make('first_name')->label('First Name')->required()->maxLength(255),
TextInput::make('last_name')->label('Last Name'),
]),
]),

Grid::make()->columns(2)->schema([
TextInput::make('first_name')->label('First Name')->columnSpan(1)->nullable(),
TextInput::make('last_name')->label('Last Name')->columnSpan(1)->nullable(),
]),

TextInput::make('email_address')->label('Email Address')->nullable(),
TextInput::make('mobile_phone')->label('Mobile Phone')->nullable(),
TextInput::make('address_1')->label('Address 1')->nullable(),
TextInput::make('address_2')->label('Address 2')->nullable(),
TextInput::make('suburb')->label('Suburb')->nullable(),
Select::make('state')->label('State')->options([
'ACT' => 'ACT',
'NT' => 'NT',
'NSW' => 'NSW',
'QLD' => 'QLD',
'SA' => 'SA',
'Tas' => 'Tas',
'Vic' => 'Vic',
'WA' => 'WA',
])->nullable(),
TextInput::make('postcode')->label('Postcode')->nullable(),
])
->statePath('data')
->model($this->record);
}
public function form(Form $form): Form
{
return $form
->schema([
Section::make()->schema([
Grid::make()->columns(2)->schema([
TextInput::make('first_name')->label('First Name')->required()->maxLength(255),
TextInput::make('last_name')->label('Last Name'),
]),
]),

Grid::make()->columns(2)->schema([
TextInput::make('first_name')->label('First Name')->columnSpan(1)->nullable(),
TextInput::make('last_name')->label('Last Name')->columnSpan(1)->nullable(),
]),

TextInput::make('email_address')->label('Email Address')->nullable(),
TextInput::make('mobile_phone')->label('Mobile Phone')->nullable(),
TextInput::make('address_1')->label('Address 1')->nullable(),
TextInput::make('address_2')->label('Address 2')->nullable(),
TextInput::make('suburb')->label('Suburb')->nullable(),
Select::make('state')->label('State')->options([
'ACT' => 'ACT',
'NT' => 'NT',
'NSW' => 'NSW',
'QLD' => 'QLD',
'SA' => 'SA',
'Tas' => 'Tas',
'Vic' => 'Vic',
'WA' => 'WA',
])->nullable(),
TextInput::make('postcode')->label('Postcode')->nullable(),
])
->statePath('data')
->model($this->record);
}
17 replies
FFilament
Created by Dave Mack on 8/23/2023 in #❓┊help
Changing the colour of field labels where a form is inside a standalone livewire component.
I am following the docs and have been able to generate a form that I can use inside my Livewire component. My issue is that my page design is quite dark, and I would want to change the colour of the labels to be white. It looks like the ->extraAttributes feature will only work on the actual field. Is there any way that I can control the label colour from within the livewire/filament component?
If I need to create a theme for this form - I also couldn't see how to associate the theme with the individual form inside my livewire component.
I'd love some advice! 🙂
6 replies