skipperbent / simple-php-router

Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.
654 stars 123 forks source link

Allow Middleware parameters #715

Open michaelthedev opened 5 months ago

michaelthedev commented 5 months ago

Allows usage of comma separated values as middleware parameters

Router::post('/purchase', [CableTvController::class, 'purchase'])
  ->addMiddleware(PinVerified::class.',value_1,value_2');

OR

Router::post('/purchase', [CableTvController::class, 'purchase'])
  ->addMiddleware('App\Middlewares\TestMiddleware,value_1,value_2');
michaelthedev commented 5 months ago

Not sure which branch i should choose. But i selected v5-development