Files
monica/app/Models/Contact/LifeEventCategory.php
T

45 lines
940 B
PHP

<?php
namespace App\Models\Contact;
use App\Models\Account\Account;
use App\Models\ModelBinding as Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class LifeEventCategory extends Model
{
protected $table = 'life_event_categories';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'account_id',
'default_life_event_category_key',
];
/**
* Get the account record associated with the life event category.
*
* @return BelongsTo
*/
public function account()
{
return $this->belongsTo(Account::class);
}
/**
* Get the life event type records associated with the category.
*
* @return HasMany
*/
public function lifeEventTypes()
{
return $this->hasMany(LifeEventType::class);
}
}