47 lines
776 B
PHP
47 lines
776 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Traits\Sampraday\Relationships;
|
||
|
|
|
||
|
|
use App\Models\Dharma;
|
||
|
|
use App\Models\Sant;
|
||
|
|
use App\Models\User;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Trait UserRelationships
|
||
|
|
* @package Domains\User\Models\Traits\Relationships
|
||
|
|
*/
|
||
|
|
trait SampradayRelationships
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function user()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'created_by');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function gachadhipati()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Sant::class, 'sant_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function dharma()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Dharma::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function sants()
|
||
|
|
{
|
||
|
|
return $this->hasMany(Sant::class);
|
||
|
|
}
|
||
|
|
}
|