Can't get the tags from controller in checkbox
In Controller
:
$tags = Tag::pluck('name','id')->all();
return view('admin.posts.create', compact('categories','tags'));
In view
:
{!! Form::label('tag_id','Select Tag') !!}
{!! Form::checkbox('tags[]',$tags,false,['class'=>'form-control']) !!}
You need to loop through the tags
@foreach($tags as $tag)
{!! Form::checkbox('tags[]', $tag->id, ['class'=>'form-control']) !!}
{!! Form::label('tags', $tag->name) !!}
@endforeach
Hope it's helpful.