40 lines
679 B
PHP
40 lines
679 B
PHP
<?php
|
|
|
|
namespace App\Models\Traits\Jati\Relationships;
|
|
|
|
use App\Constant\Constant;
|
|
use App\Models\Dharma;
|
|
use App\Models\User;
|
|
use App\Models\UserDetail;
|
|
|
|
/**
|
|
* Trait UserRelationships
|
|
* @package Domains\User\Models\Traits\Relationships
|
|
*/
|
|
trait JatiRelationships
|
|
{
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function dharma()
|
|
{
|
|
return $this->belongsTo(Dharma::class);
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function userDetails()
|
|
{
|
|
return $this->hasMany(UserDetail::class, 'jati_id');
|
|
}
|
|
}
|