![]() 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/ts.corals.io/corals-api/Corals/modules/Timesheet/Models/ |
<?php namespace Corals\Modules\Timesheet\Models; use Corals\Foundation\Models\BaseModel; use Corals\Foundation\Transformers\PresentableTrait; use Corals\Modules\Utility\Models\Tag\Tag; use Corals\User\Models\User; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Spatie\Activitylog\Traits\LogsActivity; class Project extends BaseModel { use PresentableTrait, LogsActivity; protected $table = 'timesheet_projects'; public $config = 'timesheet.models.project'; protected $guarded = ['id']; protected $casts = [ 'properties' => 'json', ]; /** * @return BelongsTo */ public function client(): BelongsTo { return $this->belongsTo(Client::class); } /** * @return HasMany */ public function entries(): HasMany { return $this->hasMany(Entry::class)->latest(); } /** * @return HasMany */ public function invoices(): HasMany { return $this->hasMany(Invoice::class)->latest(); } public function labels() { return $this->morphMany(Tag::class, 'source'); } public function users() { return $this->belongsToMany(User::class, 'timesheet_project_user')->withTimestamps(); } public function activities() { return $this->belongsToMany(Activity::class, 'timesheet_project_activity')->withTimestamps(); } public function expenses() { return $this->hasMany(Expense::class); } public function incomes() { return $this->hasMany(Income::class); } }