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
pad-upe
Commits
7fca24fc
Commit
7fca24fc
authored
Mar 11, 2022
by
alissonalbuquerque
Browse files
add model de Curso
parent
a63fdb9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Models/Curso.php
View file @
7fca24fc
...
@@ -23,5 +23,23 @@ class Curso extends Model
...
@@ -23,5 +23,23 @@ class Curso extends Model
*/
*/
protected
$fillable
=
[
'name'
,
'campus_id'
];
protected
$fillable
=
[
'name'
,
'campus_id'
];
/**
* Get Campus with campus.id = curso.campus_id
*
* @return Campus
*/
public
function
campus
()
{
return
$this
->
belongsTo
(
Campus
::
class
);
}
/**
* @return string
*/
public
function
__toString
()
{
return
$this
->
name
;
}
}
}
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