Component Groups. Closes #146.

This commit is contained in:
James Brooks
2015-01-04 20:56:10 +00:00
parent 35c0d25112
commit 0846cfdbca
12 changed files with 305 additions and 2 deletions

View File

@@ -43,7 +43,26 @@ class Component extends Model implements TransformableInterface
*
* @var string[]
*/
protected $fillable = ['name', 'description', 'status', 'user_id', 'tags', 'link', 'order'];
protected $fillable = [
'name',
'description',
'status',
'user_id',
'tags',
'link',
'order',
'group_id',
];
/**
* Components can belong to a group.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function group()
{
return $this->belongsTo('CachetHQ\Cachet\Models\ComponentGroup', 'group_id', 'id');
}
/**
* Lookup all of the incidents reported on the component.