Level 53
You can specify only or except in the middleware constructor such as, $this->middleware('auth', ['only' => ['something']]);
Is there a way I can use only in the middleware, when constructing the middleware as array?
Like:
public function __construct(){
$this->middleware([
'auth',
'middleware1',
'middleware2',
'middleware3' => [
'only' => [
'getMethodName1',
'getMethodName2',
]
],
]);
}
To assign middleware3 only to the specified methods.
Please or to participate in this conversation.