mercredi 2 septembre 2015

Get jQuery post array values in laravel

Using j Query post some data are posting. Firebug console Post are given below. How can I get tags[] result in Laravel controller page. Please check my laravel code below, $request->tags result is not getting some errors are showing "preg_replace(): Parameter mismatch, pattern is a string while replacement is an array". Please help me to solve this issue.

Fire bug console

createdby    1
tagcategoryid   1
tags[]  Music
tags[]  Reading
tags[]  test
tags[]  test1
tags[]  test2
tags[]  test3

Laravel Code

public function store(InterestRequest $request)
    {
        $tag = new Tag;
        $tag->tagcategory_id  = $request->tagcategoryid;
        $tag->title_de        = $request->tags;
        $tag->title_en        = $request->tags;
        $tag->suggestion      = 'no';
        $tag->created_by      = $request->createdby;
        $tag->save();
    }



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1JAT2YM
via IFTTT

Aucun commentaire:

Enregistrer un commentaire