zaidpirwani
zaidpirwani
FFilament
Created by zaidpirwani on 10/29/2024 in #❓┊help
Export Visible Columns ONLY
Hello, I have a table with many columns and user can make columns visible or hide as needed - I also have an EXPORT action, with Filament Exporter, I want the exporter to only export columns which are visible. in Filament, the Table columns and exporter columns are both defined in 2 separate classes table has its own list of columns and exporter has its own list of export columns https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export#defining-exporter-columns any way I can send the list of currently visible columns to the exporter. I currently have export action in page reader where the table is, but I can move the export action to table header as well.
1 replies
FFilament
Created by zaidpirwani on 6/9/2024 in #❓┊help
Edit Related Record in Modal from an Infolist RepeatableEntry / View Page
Hello, I am trying to edit a Quote record from the view page of an Order (Procurement Request) record the order record has a repeatable entry which lists all the quotes in sections - every section head has an infolist action button I want to open a modal to edit the related quote record - however, if there are any relation fields in the quote record form, filament is trying to find related relation with the Order (Procurement Request) record not the quote record.
use Filament\Infolists\Components\Actions\Action;


Action::make('editQuote')
->label('Edit Quote')
->form(Quote::getForm())
->action(function (Quote $record, array $data) {
$record->update($data);
}),

//FORM function the Quote Model - shortened
public static function getForm(): array
{
return [
Section::make('Quote Details')
->columns(2)
->schema([
TextInput::make('vendor_reference')
->label('Quote Ref. No.')
->required(),
Select::make('payment_term_id')
->relationship('paymentTerm', 'name')
->columnspan(2)
->required(),
]),
];
}
use Filament\Infolists\Components\Actions\Action;


Action::make('editQuote')
->label('Edit Quote')
->form(Quote::getForm())
->action(function (Quote $record, array $data) {
$record->update($data);
}),

//FORM function the Quote Model - shortened
public static function getForm(): array
{
return [
Section::make('Quote Details')
->columns(2)
->schema([
TextInput::make('vendor_reference')
->label('Quote Ref. No.')
->required(),
Select::make('payment_term_id')
->relationship('paymentTerm', 'name')
->columnspan(2)
->required(),
]),
];
}
Ideally I dont want to take user to another page I can also mutate the data before calling the form - the above is part of the code without the relationship field, the modal is opening
2 replies
FFilament
Created by zaidpirwani on 1/7/2024 in #❓┊help
Use Images in SelectFilter ?
images in select while attaching information
1 replies