protected function getConstructor($withAuth)
    {
        $stub = $this->getStubContent('controller-constructor');

        $middleware = $withAuth ? '$this->middleware(\'auth\');' : '';

        $this->replaceAuthMiddlewear($stub, $middleware);

        $starts = strpos($stub, '{');
        $ends = strrpos($stub, '}');

        if ($starts !== false && $ends !== false) {
            $content = trim(substr($stub, $starts + 1, $ends - $starts - 1));
            if (!empty($content)) {
                return $stub;
            }
        }

        return '';
    }
protected function getConstructor($withAuth)
    {
        $stub = $this->getStubContent('controller-constructor');

        $middleware = $withAuth ? '$this->middleware(\'auth\');' : '';

        $this->replaceAuthMiddlewear($stub, $middleware);

        $starts = strpos($stub, '{');
        $ends = strrpos($stub, '}');

        if ($starts !== false && $ends !== false) {
            $content = trim(substr($stub, $starts + 1, $ends - $starts - 1));
            if (!empty($content)) {
                return $stub;
            }
        }

        return '';
    }
protected function getConstructor ( $ withAuth ) { $ stub = $ this -> getStubContent ( 'controller-constructor' ) ; $ middleware = $ withAuth ? '$this->middleware(\'auth\');' : '' ; $ this -> replaceAuthMiddlewear ( $ stub , $ middleware ) ; $ starts = strpos ( $ stub , '{' ) ; $ ends = strrpos ( $ stub , '}' ) ; if ( $ starts !== false && $ ends !== false ) { $ content = trim ( substr ( $ stub , $ starts + 1 , $ ends - $ starts - 1 ) ) ; if ( ! empty ( $ content ) ) { return $ stub ; } } return '' ; }
Gets controller's constructor.

@param bool $withAuth

@return string
Gets controller s constructor .