I made relationship between Film
and Performer
model.
Films model:
public function Performers()
{
return $this->belongsToMany('App\Performer');
}
Performer model:
public function Films()
{
return $this->belongsToMany('App\Films');
}
I've created table film_performer
and relationship works, if I would add data manually.
I have a problem with saving data into film_performer
after send form.
Into controller I attach it.
$film->performers()->attach($request->performers);
I don't have any errors. I used dd($request)
to check array performers and everything is ok