Erik
Erik
FFilament
Created by Erik on 3/13/2024 in #❓┊help
Override traits in tables
I have found a good workaround for this problem: at composer.json file, autoload section: "exclude-from-classmap": [ "vendor/filament/tables/src/Concerns/CanToggleColumns.php", "vendor/filament/tables/src/Concerns/InteractsWithTable.php" ], "files": [ "app/Overrides/filament/tables/src/Concerns/CanToggleColumns.php", "app/Overrides/filament/tables/src/Concerns/InteractsWithTable.php" ]
3 replies
FFilament
Created by jals65 on 7/11/2023 in #❓┊help
Problems with an action.
Are you using unique id? Because it causes the same problem for me. I have changed it to "normal" auto incremental id and it started to work...
15 replies
FFilament
Created by Erik on 3/29/2023 in #❓┊help
Having in Table Filters
The code would be the following:
Tables\Filters\Filter::make('netto_sum')
->form([
Forms\Components\Fieldset::make('Összeg (nettó)')->schema([
Forms\Components\TextInput::make('from')
->label('Ettől')
->nullable()
->columnSpan([
'default' => 12,
'md' => 12,
'lg' => 6,
]),
Forms\Components\TextInput::make('until')
->label('Eddig')
->nullable()
->columnSpan([
'default' => 12,
'md' => 12,
'lg' => 6,
]),
])->columns(12)
])
->query(function (Builder $query, array $data): Builder {

return $query
->when(
$data['from'],
fn (Builder $q, $data): Builder => $q->havingRaw('netto_sum >= ?', [0])
)
->when(
$data['until'],
fn (Builder $q, $data): Builder => $q->havingRaw('netto_sum <= ?', [3100])
);
}),
Tables\Filters\Filter::make('netto_sum')
->form([
Forms\Components\Fieldset::make('Összeg (nettó)')->schema([
Forms\Components\TextInput::make('from')
->label('Ettől')
->nullable()
->columnSpan([
'default' => 12,
'md' => 12,
'lg' => 6,
]),
Forms\Components\TextInput::make('until')
->label('Eddig')
->nullable()
->columnSpan([
'default' => 12,
'md' => 12,
'lg' => 6,
]),
])->columns(12)
])
->query(function (Builder $query, array $data): Builder {

return $query
->when(
$data['from'],
fn (Builder $q, $data): Builder => $q->havingRaw('netto_sum >= ?', [0])
)
->when(
$data['until'],
fn (Builder $q, $data): Builder => $q->havingRaw('netto_sum <= ?', [3100])
);
}),
2 replies