任何人都可以帮助我理解为什么以下代码工作
$x = $widget->objGallery->galleryItems()->with(array('captions' => function($query){ $query->where('locale', 'IT' );}))->get() ;
Run Code Online (Sandbox Code Playgroud)
但是当我使用动态值时
$id='11';
$x = $widget->objGallery->galleryItems()->with(array('captions' => function($query){ $query->where('locale', $id );}))->get() ;
Run Code Online (Sandbox Code Playgroud)
在说
方法Illuminate\View\View :: __ toString()不得抛出异常