4 months ago

explode() expects parameter 2 to be string, array given

Posted 4 months ago by pHaider

Hello everyone,

I'm a newbie with Laravel and Vue, I have a tagging feature with my system and facing a problem with saving the tags!

I'm using this framework for Laravel tag: and this framework for Vue input:

For more, I'm following this tutorial to apply the tagging system:

this is my Vue code:

<tags-input class="block w-full" v-model="form.tags" element-id="tags" typeahead-style="badges" :add-tags-on-comma="true" :allow-duplicates="true" :typeahead="true" :existing-tags="existingTags"> </tags-input>

submit() {'/costs/tags', this.form) .then(response => { alert('added'); }).catch(error => { this.error =; alert(this.error); }); }

This is my Back-end code:

public function tags(Request $request) { $floor = Floor::find(1);

    $tags = explode(",", $request->tags);


Please sign in or create an account to participate in this conversation.