This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

williamson.t.p23282
williamson.t.p23282

I'm building a Captcha plugin (yes I know a few already exist) and I would like to attach my middleware only where my component runs but without routes. The goal is to be able to add my component to any form with no messing around.

I see that pure laravel would allow this via controllers but I can not see a clean way to achieve the same result with the Octobercms components Attaching the middleware to all frontend calls is easy enough, but I need the middleware to be component specific:

Cms\Classes\CmsController::extend(function($controller) { $controller->middleware('Xtremetom\Captcha\Middleware\CaptchaMiddleware'); });

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.