php-router
php-router copied to clipboard
How to use middleware separately in functions in Auto-generated Routes?
Is is possible to use two different middlewares in same controller class while using auto generated routes?
for example, in following code, how can I use SomeMiddleware only on postMethod1 but not on getMethod1.
class SomeController extends Controller
{
public $middlewareBefore = [
SomeMiddleware::class
];
public function getMethod1(Request $request)
{
}
public function postMethod1(Request $request, Response $response)
{
}
}
Hi @nabeelalihashmi , There is no way for that right now. Maybe we can plan somethings about that in the future.