i am using bootstrap Tagit inputs in my project. But i am stuck how to fill it from database record. i tried the following code but its not working please help me out. Thanks in advance
Controller
public function profile() {
$locations=User::with('visitedList','wishList')->where('id',Auth::user()->id)->get();
return view('pages/edit-profile' , compact('locations'));
}
Print on View
<label class="col-lg-3 control-label">Already visit:</label>
<div class="col-lg-8">
<input type="text" value="
@foreach ($locations[0]->visitedList as $loc)
@endforeach
" data-role="tagsinput" id="tags" name="wish-tags" class="form-control">
</div>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire