laravel 直接渲染模板,模板存到数据库,字符串

$html = '
    Hello, {{ $name }} 
    @if($condition)
    There is one record
    @endif
';
return \Illuminate\Support\Facades\Blade::render($html, ['name' => 'Julian Bashir', 'condition' => true]);

发表新评论