-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Routes do not have route prefixes when set in web.php #17
Comments
Which prefixes are missing? @arduinomaster22 |
Same problem, include FilamentMails::routes(); on web.php generate this routes: mails/{mail}/attachment/{attachment}/{filename} ................................................................................................... mails.attachment.download › Vormkracht10\FilamentMails › MailDownloadController But on mail preview this route is call: Route [filament.admin.mails.preview] not defined. |
@arduinomaster22 do you have any time to a look at it? Or should I check it? |
I encountered an issue with FilamentMails::routes(), where the route names did not align with my Filament admin panel structure. To resolve this, I temporarily commented out FilamentMails::routes() and manually defined the routes with adjusted names
This fix ensures the routes are properly prefixed under filament.admin. However, it would be great to have a way to customize route names directly from the package to avoid modifying core behavior. Let me know if there's a better approach! |
public static function routes(?string $path = null, ?string $name = null): void
{
$path = $path !== null ? $path : filament()->getDefaultPanel()->getPath();
$name = $name !== null ? $name : 'filament.'.filament()->getDefaultPanel()->getId();
Route::prefix($path)
->name($name)
->group(function () {
Route::get('mails/{mail}/preview', MailPreviewController::class)->name('mails.preview');
Route::get('mails/{mail}/attachment/{attachment}/{filename}', MailDownloadController::class)->name('mails.attachment.download');
});
} I think something like this could be it @Baspa |
What happened?
When this is set in the
web.php
file, this does not have the prefixes of routes like the routes that are registered through the Filament Panel.FilamentMails::routes();
How to reproduce the bug
Add:
FilamentMails::routes();
to
web.php
in any Laravel app.Package Version
2.0.0
PHP Version
8.2.0
Laravel Version
11.0.0
Which operating systems does with happen with?
No response
Notes
No response
The text was updated successfully, but these errors were encountered: