我有一个带有幼虫的多浪站点。我要把子弹传给救护人员。从berita传递到beritaDetail。但它会显示错误,当使用dd($berita)时,仅显示null
$title = "title_".App::getLocale()." as title";
$content = "content_".App::getLocale()." as content";
$slug = "slug_".App::getLocale();
$berita = Report::select("*", "$title", "$content")->where('slug_'.App::getLocale(), $slug)->first();
dd($berita);
$beritaRandom = Report::take(6)->inRandomOrder()->get();
return view('frontend.pages.berita_detail', array('berita' => $berita,
'beritaRandom' => $beritaRandom ));我希望输出是$berita包含一个包含与slug匹配的字段的数组,而不是空或空数组
发布于 2019-01-31 08:55:37
$slug = "slug_".App::getLocale();
$berita = Report::select("*", "$title", "$content")->where('slug_'.App::getLocale(), $slug)->first();您在这里所做的实际上是检查slug_LOCALE是否等于它自己。因此,在转储$berita时,预计会得到null。
祝好运
https://stackoverflow.com/questions/54451789
复制相似问题