public function prependMiddlewareToGroup($group, $middleware)
    {
        if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) {
            array_unshift($this->middlewareGroups[$group], $middleware);
        }

        return $this;
    }
public function prependMiddlewareToGroup($group, $middleware)
    {
        if (isset($this->middlewareGroups[$group]) && ! in_array($middleware, $this->middlewareGroups[$group])) {
            array_unshift($this->middlewareGroups[$group], $middleware);
        }

        return $this;
    }
public function prependMiddlewareToGroup ( $ group , $ middleware ) { if ( isset ( $ this -> middlewareGroups [ $ group ] ) && ! in_array ( $ middleware , $ this -> middlewareGroups [ $ group ] ) ) { array_unshift ( $ this -> middlewareGroups [ $ group ] , $ middleware ) ; } return $ this ; }
Add a middleware to the beginning of a middleware group.

If the middleware is already in the group, it will not be added again.

@param  string  $group
@param  string  $middleware
@return $this
Add a middleware to the beginning of a middleware group .