Support the ongoing development of Laravel.io →
posted 9 years ago
Requests

What's the best practice now for how to replace the functionality lost from Route::when()?

I use it to apply conditional middleware on POST requests: Route::when('folder/*/edit', 'role:can_edit', array('post', 'delete', 'put', 'patch'));

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

wmather wmather Joined 11 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.