Commit 7fca24fc authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

add model de Curso

parent a63fdb9c
...@@ -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;
}
} }
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