mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
47 lines
920 B
PHP
47 lines
920 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Cachet.
|
|
*
|
|
* (c) Cachet HQ <support@cachethq.io>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace CachetHQ\Cachet\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Watson\Validating\ValidatingTrait;
|
|
|
|
class ComponentGroup extends Model
|
|
{
|
|
use ValidatingTrait;
|
|
|
|
/**
|
|
* The validation rules.
|
|
*
|
|
* @var string[]
|
|
*/
|
|
protected $rules = [
|
|
'name' => 'required|unique:component_groups',
|
|
];
|
|
|
|
/**
|
|
* The fillable properties.
|
|
*
|
|
* @var string[]
|
|
*/
|
|
protected $fillable = ['name', 'order'];
|
|
|
|
/**
|
|
* A group can have many components.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function components()
|
|
{
|
|
return $this->hasMany(Component::class, 'group_id', 'id');
|
|
}
|
|
}
|