Support the ongoing development of Laravel.io →
Input Database Installation
Last updated 2 years ago.
0

Is developer a related model or just the model's property?

Last updated 9 years ago.
0

You could do this..

$model->developer = json_encode( Input::get('developers') ) ;

0

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
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.