Commit 2c8e7fe1 authored by S-Nathalia's avatar S-Nathalia
Browse files

criacao da relacao entre proponente de cursos

parent beaa4ae2
...@@ -6,5 +6,12 @@ use Illuminate\Database\Eloquent\Model; ...@@ -6,5 +6,12 @@ use Illuminate\Database\Eloquent\Model;
class Curso extends Model class Curso extends Model
{ {
// protected $fillable = [
'nome',
];
public function proponentes()
{
return $this->belongsToMany('App\Proponente', 'proponentes_cursos', 'curso_id');
}
} }
...@@ -14,4 +14,9 @@ class Proponente extends Model ...@@ -14,4 +14,9 @@ class Proponente extends Model
public function trabalhos(){ public function trabalhos(){
return $this->hasMany('App\Trabalho'); return $this->hasMany('App\Trabalho');
} }
public function cursos()
{
return $this->belongsToMany('App\Curso', 'proponentes_cursos', 'proponente_id');
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment