53 lines
1.0 KiB
PHP
53 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Meeting\Models;
|
|
|
|
use App\Traits\CreatedUpdatedBy;
|
|
use App\Traits\StatusTrait;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Modules\Client\Models\Client;
|
|
use Modules\Employee\Models\Employee;
|
|
|
|
class Meeting extends Model
|
|
{
|
|
use CreatedUpdatedBy, StatusTrait;
|
|
use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships;
|
|
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'date',
|
|
'meeting_with',
|
|
'client_id',
|
|
'members',
|
|
'start_time',
|
|
'location',
|
|
'description',
|
|
'status',
|
|
'createdby',
|
|
'updatedby',
|
|
];
|
|
|
|
protected $casts = [
|
|
'members' => 'array',
|
|
'date' => 'date',
|
|
'start_time' => 'datetime',
|
|
];
|
|
public $appends = ['status_name'];
|
|
|
|
public function client()
|
|
{
|
|
return $this->belongsTo(Client::class, 'client_id');
|
|
}
|
|
|
|
public function assignedUser()
|
|
{
|
|
return $this->belongsToJson(Employee::class, 'members->ids');
|
|
}
|
|
|
|
}
|