keithjk
keithjk
FFilament
Created by keithjk on 7/18/2024 in #❓┊help
Excel Export with Date Column
Hello, I am trying to use the Actions to export data to Excel (CSV). The function works great except when including a DateTime column. When I include any DateTime column in the export, it returns a blank export. I've also tried to use the formatStateUsing() function to ensure it's converting to a string, with no luck. I've looked through the docs and don't see any information specific to Date or DateTime fields when exporting to Excel. Has anyone else run into this issue and know how to solve? Or is this a known field type that can't be exported and I'm just not seeing that?
class MailchimpExport extends Exporter
{
protected static ?string $model = EventAttendance::class;

/**
* Export columns.
*/
public static function getColumns(): array
{
return [
ExportColumn::make('attendee_email')
->label('Email Address'),
ExportColumn::make('attendee_name_first')
->label('First Name'),
ExportColumn::make('attendee_name_last')
->label('Last Name'),
ExportColumn::make('attendee_company')
->label('Company'),
ExportColumn::make('attendee_title')
->label('Title'),
ExportColumn::make('get_profession.title')
->label('Profession'),
ExportColumn::make('pronouns')
->label('What are your pronouns?'),
ExportColumn::make('event.chapters')
->label('What groups are you interested in hearing about?')
->formatStateUsing(function ($state): ?string {
return implode('; ', $state->pluck('title')->toArray());
}),
ExportColumn::make('eventbrite_order_timestamp')
->label('Test')
->formatStateUsing(function ($state): ?string {
return $state->toISOString();
}),
];
}
class MailchimpExport extends Exporter
{
protected static ?string $model = EventAttendance::class;

/**
* Export columns.
*/
public static function getColumns(): array
{
return [
ExportColumn::make('attendee_email')
->label('Email Address'),
ExportColumn::make('attendee_name_first')
->label('First Name'),
ExportColumn::make('attendee_name_last')
->label('Last Name'),
ExportColumn::make('attendee_company')
->label('Company'),
ExportColumn::make('attendee_title')
->label('Title'),
ExportColumn::make('get_profession.title')
->label('Profession'),
ExportColumn::make('pronouns')
->label('What are your pronouns?'),
ExportColumn::make('event.chapters')
->label('What groups are you interested in hearing about?')
->formatStateUsing(function ($state): ?string {
return implode('; ', $state->pluck('title')->toArray());
}),
ExportColumn::make('eventbrite_order_timestamp')
->label('Test')
->formatStateUsing(function ($state): ?string {
return $state->toISOString();
}),
];
}
2 replies
FFilament
Created by keithjk on 8/27/2023 in #❓┊help
GET method not supported for route livewire/update
Hello all. I've been working on an pplication for some time, which includes some Relation Managers. The relation manager worked in v2 but when I updated to v3, certain actions on the relation manager started to lead to a black frame. When I open the error link in a new tab, it says, "The GET method is not supported for route livewire/update. Supported methods: POST." This error comes from both built-in actions, and custom actions. I've reloaded assets, updated packages, cleared caches and the works. I've even recompiled my containers. But can't get the actions to work. I've been running through several efforts to try and get the action to run, including rebuilding the resources and relation managers from scratch. I've noticed that when dealing with direct fields to the model at hand, it works fine. But when I try to include BelongsToMany relations, is when the error occurs. Any general guidance on how to deal with this error? https://flareapp.io/share/87nYgYMP
6 replies