Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
2c8e7fe1
Commit
2c8e7fe1
authored
Oct 25, 2022
by
S-Nathalia
Browse files
criacao da relacao entre proponente de cursos
parent
beaa4ae2
Changes
2
Show whitespace changes
Inline
Side-by-side
app/Curso.php
View file @
2c8e7fe1
...
@@ -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'
);
}
}
}
app/Proponente.php
View file @
2c8e7fe1
...
@@ -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'
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment