Support the ongoing development of Laravel.io →
Requests Architecture

I'm trying to create a route filter that will accept multiple parameters (got it working with one parameter). For example, I'd like to do this:

Route::filter("multiTest", function($route, $request, $parameters) {
    // code here
});

And then call it like this:

Route::group(array('before' => 'multiTest:1:2:3'), function() {
    Route::get('multiTest', function() {
        // more code here
    });
});

Is there a method on the Route facade that returns an array of parameters passed to the filter? I suppose I can parse it manually (explode $parameters on :) but it seems like there should be a built-in way of doing that?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

tmountjr tmountjr Joined 15 Apr 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.