i can store tags from database, but when i try to input tags manually, i can't do that because the new tag not store in database.
here is what can i do so far
my controller to store data
$data = $this->handleRequest($request);//for handle image request
$newPost = $request->user()->posts()->create($data);
$newPost->tags()->sync($request->tags, false);
my form
{!!Form::select('Tags',$tags->pluck('name','id')->all(),null,array(
'multiple' => 'multiple',
'class' => 'form-control select2-multi',
'name' => 'tags[]'))
!!}
and script
$('.select2-multi').select2({
tags: true,
tokenSeparators: [","]
}).
val({!! json_encode($post->tags()->pluck('id')->toArray())!!}).trigger('change');