spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Middleware Group for the Front routes #157

Closed renatonascalves closed 4 years ago

renatonascalves commented 4 years ago

I'm looking for a way to add a custom middleware to a specific route:

Route::post('subscribe/{emailListUuid}', '\\' . SubscribeController::class)->name('mailcoach.subscribe')
    ->middleware(\Spatie\Honeypot\ProtectAgainstSpam::class);

The use case is that the newsletter form is in another site and I'm using the Laravel Honeypot package, together with a NeverBounce integration to decrease spam (together with other honey pot fixes).

The problem is that right now I need to edit core files (laravel-mailcoach on the vendor folder) to accomplish it. And adding the middleware in the Kernel.php is affecting other POST requests.

Could you add the Front routes to a group so that others can add their own middlewares to it?

freekmurze commented 4 years ago

Sure, I'll take care of this in the next few weeks. If you need it fast, I'd accept a PR that adds this to the package.

renatonascalves commented 4 years ago

@freekmurze Happy to! But isn't laravel-mailcoach a private repo? I can't find this repo on the Spatie org.

freekmurze commented 4 years ago

@renatonascalves you can request access via your account at https://mailcoach.app

Screenshot 2020-04-23 at 09 27 14
renatonascalves commented 4 years ago

Have access now! Tks! :)

freekmurze commented 4 years ago

To keep our issue tracker clean, I'm going to close this one, but will revisit this in the future. Like said above, if you needs this quick, send a PR 👍

Thank you for your Mailcoach tweet earlier today, really made my day 😄