47 lines
868 B
PHP
47 lines
868 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Traits\ChaturmasDate\Relationships;
|
||
|
|
|
||
|
|
use App\Models\Chaturmas;
|
||
|
|
use App\Models\ChaturmasReview;
|
||
|
|
use App\Models\User;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Trait ChaturmasRelationships
|
||
|
|
* @package Domains\Chaturmas\Models\Traits\Relationships
|
||
|
|
*/
|
||
|
|
trait ChaturmasDateRelationships
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function createdBy()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'created_by');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function updatedBy()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'updated_by');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function chaturmas()
|
||
|
|
{
|
||
|
|
return $this->hasMany(Chaturmas::class, 'chaturmas_date_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function reviews()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(ChaturmasReview::class, 'chaturmas_id');
|
||
|
|
}
|
||
|
|
}
|