first change
This commit is contained in:
52
Modules/Meeting/app/Models/Meeting.php
Normal file
52
Modules/Meeting/app/Models/Meeting.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user