Is developer a related model or just the model's property?
You could do this..
$model->developer = json_encode( Input::get('developers') ) ;
Assuming each developer is a model, you can simply sync the ids
class Project
{
public function developers()
{
return $this->belongsToMany(Developer::class);
}
}
class Developer
{
public function projects()
{
return $this->belongsToMany(Project::class);
}
}
$project->developers()->sync(Input::get('developers')); // an array of developer model ids
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community