master

laravel/framework

Last updated at: 29/12/2023 09:25

HasMiddleware.php

TLDR

This file defines an interface HasMiddleware within the Illuminate\Routing\Controllers namespace.

Methods

middleware()

This method is a static method that should be implemented by classes that implement the HasMiddleware interface. It returns the middleware that should be assigned to the controller. The return type can be either \Illuminate\Routing\Controllers\Middleware or an array of middleware.

<?php

namespace Illuminate\Routing\Controllers;

interface HasMiddleware
{
    /**
     * Get the middleware that should be assigned to the controller.
     *
     * @return \Illuminate\Routing\Controllers\Middleware|array
     */
    public static function middleware();
}