The error traces back to vendor/rickdbcn/filament-email/src/Filament/Resources/EmailResource.php on line 34:
return __('Config::get('filament-email.label')') ?? __('Email log');
The issue seems to be with the incorrect usage of single quotes inside the translation function. Instead of evaluating the Config::get() method, it's treated as a literal string causing the syntax error.
How to reproduce the bug
Install the rickdbcn/filament-email package.
Run composer update.
Navigate to any route or command that would use the EmailResource class from the filament-email package.
The error should appear and reference the mentioned line of code.
Package Version
1.0.8
PHP Version
8.2.10
Laravel Version
10.30.1
Which operating systems does with happen with?
Linux
Notes
A possible fix for the getNavigationLabel method is:
return __(Config::get('filament-email.label', 'Email log'));
The getNavigationGroup method has an incorrect usage of the nullish coalescing operator. The correct implementation should be:
return __(Config::get('filament-email.resource.group', parent::getNavigationGroup()));
It would be beneficial to add unit tests to catch these kinds of issues in the future.
What happened?
After running composer update, I encountered a ParseError with the message:
syntax error, unexpected identifier "filament", expecting ")"
The error traces back to vendor/rickdbcn/filament-email/src/Filament/Resources/EmailResource.php on line 34:
return __('Config::get('filament-email.label')') ?? __('Email log');
The issue seems to be with the incorrect usage of single quotes inside the translation function. Instead of evaluating the Config::get() method, it's treated as a literal string causing the syntax error.
How to reproduce the bug
Package Version
1.0.8
PHP Version
8.2.10
Laravel Version
10.30.1
Which operating systems does with happen with?
Linux
Notes
A possible fix for the getNavigationLabel method is:
return __(Config::get('filament-email.label', 'Email log'));
The getNavigationGroup method has an incorrect usage of the nullish coalescing operator. The correct implementation should be:
return __(Config::get('filament-email.resource.group', parent::getNavigationGroup()));
It would be beneficial to add unit tests to catch these kinds of issues in the future.
Thank you for looking into this!