public function component($path, $alias = null)
    {
        $alias = $alias ?: Arr::last(explode('.', $path));

        $this->directive($alias, function ($expression) use ($path) {
            return $expression
                        ? "<?php \$__env->startComponent('{$path}', {$expression}); ?>"
                        : "<?php \$__env->startComponent('{$path}'); ?>";
        });

        $this->directive('end'.$alias, function ($expression) {
            return '<?php echo $__env->renderComponent(); ?>';
        });
    }
public function component($path, $alias = null)
    {
        $alias = $alias ?: Arr::last(explode('.', $path));

        $this->directive($alias, function ($expression) use ($path) {
            return $expression
                        ? "<?php \$__env->startComponent('{$path}', {$expression}); ?>"
                        : "<?php \$__env->startComponent('{$path}'); ?>";
        });

        $this->directive('end'.$alias, function ($expression) {
            return '<?php echo $__env->renderComponent(); ?>';
        });
    }
public function component ( $ path , $ alias = null ) { $ alias = $ alias ? : Arr :: last ( explode ( '.' , $ path ) ) ; $ this -> directive ( $ alias , function ( $ expression ) use ( $ path ) { return $ expression ? "<?php \$__env->startComponent('{$path}', {$expression}); ?>" : "<?php \$__env->startComponent('{$path}'); ?>" ; } ) ; $ this -> directive ( 'end' . $ alias , function ( $ expression ) { return '<?php echo $__env->renderComponent(); ?>' ; } ) ; }
Register a component alias directive.

@param  string  $path
@param  string  $alias
@return void
Register a component alias directive .