在 Laravel 的指令中使用方括号

Use brackets in a Laravel's directivе

我试图在 Laravel 的指令中添加一个 closing/opening 括号,但是 PhpStorm 在这里显示错误:(

Laravel 说:ErrorException Undefined property: Illuminate\View\Factory::$startSectionParseError syntax error, unexpected '?'

代码行:@section('error-message', 'Oops :(')

我该怎么办?谢谢:)

一般来说这种事情是不可能的,因为Blade使用正则表达式解析的局限性。我建议只使用普通部分输入:

@section('error-title')
Not found :(
@endsection