Curator media route does not support middleware (breaks multi-tenant apps) #637
luckykenlin
started this conversation in
Ideas
Replies: 1 comment
-
|
for anyone running into the same problem I managed to get Curator working with multi-tenancy by simply overriding the route and adding my tenant middleware manually. Here’s what I added to my routes file: (tenant.php) This replaces the default Curator route and makes sure the tenant is initialized before serving the media. Would still be great if the package allowed adding middleware directly in the config, but this workaround does the job for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Filament Version: v4
Plugin Version: v4
PHP Version: 8.4
The Curator package registers its media delivery route like this:
Route::prefix(config('curator.glide.route_path', 'curator'))
->get('/{path}', [MediaController::class, 'show'])
->where('path', '.*');
This route does not support adding middleware, which becomes a problem when the application uses multi-tenancy (e.g., Stancl Tenancy).
Because no middleware can be applied, the request does not enter the tenant context, so storage lookups break.
Beta Was this translation helpful? Give feedback.
All reactions