public function edit($id)
{
$blogs=Blog::findOrFail($id);
$tags =$blogs->tags;
$metaKeywords = $blogs->keywords;
return view('admin.cms.blogs.edit_blog',compact('blogs','tags','metaKeywords'));
}
我的观点
<input type="text" class="form-control product-tags"
name="tags"
@foreach($tags as $tag ) value="{{ $tag->tag_name }} "
@endforeach>
我只得到一个阀门文本框,但数据库中有很多标签 请建议我一个想法
答案 0 :(得分:1)
尝试
<input type="text" class="form-control product-tags" name="tags"
value = "@foreach($tags as $tag ){{ $tag->tag_name }} @endforeach">