public function if($name, callable $callback)
    {
        $this->conditions[$name] = $callback;

        $this->directive($name, function ($expression) use ($name) {
            return $expression !== ''
                    ? "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>"
                    : "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>";
        });

        $this->directive('else'.$name, function ($expression) use ($name) {
            return $expression !== ''
                ? "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>"
                : "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>";
        });

        $this->directive('end'.$name, function () {
            return '<?php endif; ?>';
        });
    }
public function if($name, callable $callback)
    {
        $this->conditions[$name] = $callback;

        $this->directive($name, function ($expression) use ($name) {
            return $expression !== ''
                    ? "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>"
                    : "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>";
        });

        $this->directive('else'.$name, function ($expression) use ($name) {
            return $expression !== ''
                ? "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>"
                : "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>";
        });

        $this->directive('end'.$name, function () {
            return '<?php endif; ?>';
        });
    }
public function if ( $ name , callable $ callback ) { $ this -> conditions [ $ name ] = $ callback ; $ this -> directive ( $ name , function ( $ expression ) use ( $ name ) { return $ expression !== '' ? "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>" : "<?php if (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>" ; } ) ; $ this -> directive ( 'else' . $ name , function ( $ expression ) use ( $ name ) { return $ expression !== '' ? "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}', {$expression})): ?>" : "<?php elseif (\Illuminate\Support\Facades\Blade::check('{$name}')): ?>" ; } ) ; $ this -> directive ( 'end' . $ name , function ( ) { return '<?php endif; ?>' ; } ) ; }
Register an "if" statement directive.

@param  string  $name
@param  callable  $callback
@return void
Register an if statement directive .