[Bug] TypeError thrown when notification is sent #267

Closed
opened 2026-06-08 08:39:26 +00:00 by Perturbatio · 3 comments
Perturbatio commented 2026-06-08 08:39:26 +00:00 (Migrated from github.com)

Using Laravel 13

When an export is done and a notification is sent, there is a TypeError exception thrown in vendor/pxlrbt/filament-excel/src/FilamentExport.php line 29

This appears to be a side-effect of the stricter php class serialisation introduced in L13.

The cause of the error appears to be the storage of a UuidInterface class instance rather than the UUID itself.

Actual error triggered in: \pxlrbt\FilamentExcel\FilamentExcelServiceProvider::cacheExportFinishedNotification

Assuming this is the only occurrence of caching, the following should be enough to resolve this:

        $exports[] = [
            'id' => Str::uuid()->toString(),
            'filename' => $event->filename,
            'userId' => $event->userId,
            'locale' => $event->locale,
        ];

patch:

diff --git a/src/FilamentExcelServiceProvider.php b/src/FilamentExcelServiceProvider.php
index 1ebe32a..df42b8d 100644
--- a/src/FilamentExcelServiceProvider.php
+++ b/src/FilamentExcelServiceProvider.php
@@ -53,7 +53,7 @@ class FilamentExcelServiceProvider extends PackageServiceProvider
 
         $exports = cache()->pull($key, []);
         $exports[] = [
-            'id' => Str::uuid(),
+            'id' => Str::uuid()->toString(),
             'filename' => $event->filename,
             'userId' => $event->userId,
             'locale' => $event->locale,
Using Laravel 13 When an export is done and a notification is sent, there is a TypeError exception thrown in `vendor/pxlrbt/filament-excel/src/FilamentExport.php` line 29 This appears to be a side-effect of the stricter php [class serialisation introduced in L13](https://laravel.com/docs/13.x/upgrade#cache-serializable_classes-configuration). The cause of the error appears to be the storage of a `UuidInterface` class instance rather than the UUID itself. Actual error triggered in: `\pxlrbt\FilamentExcel\FilamentExcelServiceProvider::cacheExportFinishedNotification` Assuming this is the only occurrence of caching, the following should be enough to resolve this: ``` $exports[] = [ 'id' => Str::uuid()->toString(), 'filename' => $event->filename, 'userId' => $event->userId, 'locale' => $event->locale, ]; ``` patch: ``` diff --git a/src/FilamentExcelServiceProvider.php b/src/FilamentExcelServiceProvider.php index 1ebe32a..df42b8d 100644 --- a/src/FilamentExcelServiceProvider.php +++ b/src/FilamentExcelServiceProvider.php @@ -53,7 +53,7 @@ class FilamentExcelServiceProvider extends PackageServiceProvider $exports = cache()->pull($key, []); $exports[] = [ - 'id' => Str::uuid(), + 'id' => Str::uuid()->toString(), 'filename' => $event->filename, 'userId' => $event->userId, 'locale' => $event->locale, ```
pxlrbt commented 2026-06-15 14:05:56 +00:00 (Migrated from github.com)

Thanks.

Assuming this is the only occurrence of caching, the following should be enough to resolve this

Did you validate this is working?

Thanks. > Assuming this is the only occurrence of caching, the following should be enough to resolve this Did you validate this is working?
Perturbatio commented 2026-06-15 14:39:10 +00:00 (Migrated from github.com)

The patch works in our codebase, yes. I'm currently applying it via composer-patches.

The patch works in our codebase, yes. I'm currently applying it via composer-patches.
pxlrbt commented 2026-08-14 16:16:35 +00:00 (Migrated from github.com)

Thanks. I merged a fix for this.

Thanks. I merged a fix for this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pxlrbt/filament-excel#267
No description provided.