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
1962909d
Commit
1962909d
authored
Oct 21, 2022
by
unknown
Browse files
criação e alteração dos models para a relação com a ODS
parent
0fb4cdf0
Changes
2
Show whitespace changes
Inline
Side-by-side
app/ObjetivoDeDesenvolvimentoSustentavel.php
0 → 100644
View file @
1962909d
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
ObjetivoDeDesenvolvimentoSustentavel
extends
Model
{
protected
$fillable
=
[
'nome'
,
];
public
function
trabalhos
(){
return
$this
->
belongsToMany
(
'App\Trabalho'
,
'objetivo_de_desenvolvimento_sustentavel_trabalhos'
,
'objetivo_de_desenvolvimento_sustentavel_id'
);
}
}
app/Trabalho.php
View file @
1962909d
...
@@ -125,4 +125,8 @@ class Trabalho extends Model
...
@@ -125,4 +125,8 @@ class Trabalho extends Model
{
{
return
$this
->
hasMany
(
Certificado
::
class
,
'trabalho_id'
);
return
$this
->
hasMany
(
Certificado
::
class
,
'trabalho_id'
);
}
}
public
function
ods
(){
return
$this
->
belongsToMany
(
'App\ObjetivoDeDesenvolvimentoSustentavel'
,
'objetivo_de_desenvolvimento_sustentavel_trabalhos'
,
'trabalho_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