I tried it with QUEUE_CONNECTION=sync now and it worked. What I want is to use it with database notifications, and this is somehow not working. This should be only a config issue.
Jan 25, 2025
6
Level 1
Filament 3 export always fails
I am trying to export records in filament 3, but I always get a notification with
Your client export has completed and 0 rows exported. 1 row failed to export.
I did everything like in the filament docs stated.
My Export class looks like
<?php
namespace App\Filament\App\Exports;
use App\Models\Client;
use Filament\Actions\Exports\Exporter;
use Filament\Actions\Exports\ExportColumn;
use Filament\Actions\Exports\Models\Export;
class ClientExporter extends Exporter
{
protected static ?string $model = Client::class;
public static function getColumns(): array
{
return [
ExportColumn::make('salutation'),
ExportColumn::make('gender'),
ExportColumn::make('firstname'),
ExportColumn::make('lastname'),
ExportColumn::make('email'),
ExportColumn::make('phone'),
ExportColumn::make('whatsapp_number'),
ExportColumn::make('address'),
ExportColumn::make('city'),
ExportColumn::make('state'),
ExportColumn::make('zip'),
ExportColumn::make('country'),
ExportColumn::make('budget'),
ExportColumn::make('period'),
ExportColumn::make('property_type'),
ExportColumn::make('property_payment'),
ExportColumn::make('property_status'),
ExportColumn::make('property_finished'),
ExportColumn::make('property_location'),
ExportColumn::make('residency'),
ExportColumn::make('newsletter'),
ExportColumn::make('partner'),
ExportColumn::make('follow_up'),
ExportColumn::make('follow_up_reminder'),
ExportColumn::make('groups'),
ExportColumn::make('additional_persons')
->listAsJson(),
ExportColumn::make('additional_info')
->listAsJson(),
ExportColumn::make('personal_info')
->listAsJson(),
ExportColumn::make('notes'),
];
}
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your client export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;
}
}
my .env file
BROADCAST_CONNECTION=log
FILESYSTEM_DISK=s3
FILAMENT_FILESYSTEM_DISK=s3
QUEUE_CONNECTION=database
and I run in my console
php artisan queue:work
What I am doing wrong here?
Please or to participate in this conversation.