vendredi 25 septembre 2020

How to attach middleware to an existing named route from a package in laravel 5?

I'm trying to extend an existing application without modifying its source code. The application has a named route called wizard-add. Is there a way to register \MyPackage\MyMiddleware with the existing route? I tried attaching it via Route::getRoutes()->getByName('wizard-add')->middleware(\MyPackage\MyMiddleware::class); but since packages are registered before the routes are read, Route::getRoutes() returns an empty collection.

Thank you!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/36dUwv8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire