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.
631 stars 116 forks source link

Allow Middleware parameters #715

Open michaelthedev opened 1 month ago

michaelthedev commented 1 month 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 1 month ago

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