![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/dceprojects.corals.io/Corals/modules/Timesheet/Models/ |
<?php namespace Corals\Modules\Timesheet\Models; use Corals\Foundation\Models\BaseModel; use Corals\Foundation\Traits\ModelUniqueCode; use Corals\Foundation\Transformers\PresentableTrait; use Corals\Modules\Utility\Models\ListOfValue\ListOfValue; use Illuminate\Database\Eloquent\Relations\MorphMany; use Spatie\Activitylog\Traits\LogsActivity; class Job extends BaseModel { use PresentableTrait, LogsActivity, ModelUniqueCode; protected $table = 'ts_jobs'; /** * Model configuration. * @var string */ public $config = 'timesheet.models.job'; protected $formModalConfig = ['size' => 'modal-lg']; protected static $logAttributes = []; protected $casts = [ 'properties' => 'json', ]; protected $guarded = ['id']; public function departments() { return $this->belongsToMany( ListOfValue::class, 'ts_department_job', 'job_id', 'department_code', 'id', 'code' )->withPivot('hours'); } public function entries(): MorphMany { return $this->morphMany(Entry::class, 'entrieable'); } public function employees() { return $this->belongsToMany(Employee::class, 'ts_employee_job', 'job_id', 'user_id'); } }