vendredi 24 novembre 2017

Laravel Relational Database how to change my form which i want can someone help one

how can i make relational database in linking to database my form is down below but have to change syncing type

i want to change this form in laravel

   $post = new Standard;
     $post->name = $request->name;
     $post->save();
     $post->subjects()->sync($request->subjects,false);

into this form

 $formInput=$request->all();
        Standard::create($formInput);
        return redirect()->route('academic_class.index');

how can i add this line in it

 $standard->subjects()->sync($request->subjects,false);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire