Laravel 5 - Defining middleware for multiple routes in controller file Laravel 5 - Defining middleware for multiple routes in controller file php php

Laravel 5 - Defining middleware for multiple routes in controller file


Simply pass an array instead of a string with | delimiter:

public function __construct(){    $this->middleware('admin', ['only' => ['create', 'edit', 'show']]);}