Files
monica/app/Models/RelationshipType.php
T
2021-12-04 18:26:14 -05:00

36 lines
754 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class RelationshipType extends Model
{
use HasFactory;
protected $table = 'relationship_types';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'relationship_group_type_id',
'name',
'name_reverse_relationship',
];
/**
* Get the group type associated with the relationship type.
*
* @return BelongsTo
*/
public function groupType()
{
return $this->belongsTo(RelationshipGroupType::class, 'relationship_group_type_id');
}
}