How to apply middleware to a custom page?
In web.php against the route I am adding a middleware but it is not working.
Solution:Jump to solution
On the page apply it as a property:
protected static string | array $routeMiddleware = [MyMiddleware::class];...
2 Replies
Solution
On the page apply it as a property:
protected static string | array $routeMiddleware = [MyMiddleware::class];
It became $routeMiddleware in V3