Commit a63fdb9c authored by alissonalbuquerque's avatar alissonalbuquerque
Browse files

add model de Campus

parent 983c2ceb
......@@ -21,6 +21,23 @@ class Campus extends Model
*
* @var array
*/
protected $fillable = ['name', 'unidade'];
protected $fillable = ['name', 'unidade_id'];
/**
* Get Unidade with unidade.id = campus.unidade_id
*
* @return Unidade
*/
public function unidade()
{
return $this->belongsTo(Unidade::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