src/Routable.php
public function before($callable=null)
    {
        if (is_null($callable)) {
            return $this->beforePrepares;
        }

        $this->beforePrepares[] = new CallableDeferred($callable, $this->container);
        
        return $this;
    }
public function before($callable=null)
    {
        if (is_null($callable)) {
            return $this->beforePrepares;
        }

        $this->beforePrepares[] = new CallableDeferred($callable, $this->container);
        
        return $this;
    }
Get/Set before middleware to the middleware collection

@param callable|string $callable The callback routine

@return static