48 lines
832 B
PHP
48 lines
832 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Traits\Vihar\Relationships;
|
||
|
|
|
||
|
|
use App\Models\Sant;
|
||
|
|
use App\Models\User;
|
||
|
|
use App\Models\Activity;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Trait ViharRelationships
|
||
|
|
* @package Domains\Vihar\Models\Traits\Relationships
|
||
|
|
*/
|
||
|
|
trait ViharRelationships
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function sant()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Sant::class);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function createdBy()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'created_by', 'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function updatedBy()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(User::class, 'updated_by', 'id');
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @return mixed
|
||
|
|
*/
|
||
|
|
public function activity()
|
||
|
|
{
|
||
|
|
return $this->belongsTo(Activity::class, 'sant_id', 'subject_id');
|
||
|
|
}
|
||
|
|
}
|