74 lines
1.3 KiB
PHP
74 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Traits\Chaturmas\Relationships;
|
|
|
|
use App\Models\Activity;
|
|
use App\Models\ChaturmasDate;
|
|
use App\Models\Sant;
|
|
use App\Models\ChaturmasReview;
|
|
use App\Models\Sangh;
|
|
use App\Models\User;
|
|
|
|
/**
|
|
* Trait ChaturmasRelationships
|
|
* @package Domains\Chaturmas\Models\Traits\Relationships
|
|
*/
|
|
trait ChaturmasRelationships
|
|
{
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function createdBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function updatedBy()
|
|
{
|
|
return $this->belongsTo(User::class, 'updated_by', 'id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function chaturmasInfo()
|
|
{
|
|
return $this->belongsTo(ChaturmasDate::class, 'chaturmas_date_id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function sant()
|
|
{
|
|
return $this->belongsTo(Sant::class, 'sant_id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function activity()
|
|
{
|
|
return $this->belongsTo(Activity::class, 'sant_id', 'subject_id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function reviews()
|
|
{
|
|
return $this->belongsTo(ChaturmasReview::class, 'chaturmas_id');
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function sangh()
|
|
{
|
|
return $this->belongsTo(Sangh::class, 'sangh_id');
|
|
}
|
|
}
|