![]() 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/ProjectPlan/Models/ |
<?php namespace Corals\Modules\ProjectPlan\Models; use Corals\Foundation\Models\BaseModel; use Corals\Foundation\Transformers\PresentableTrait; use Corals\Modules\Survey\Contracts\ModelSurveyContract; use Corals\Modules\Survey\Traits\ModelSurveyTrait; use Corals\Modules\Utility\Models\ListOfValue\ListOfValue; use Corals\User\Models\User; use Illuminate\Support\Facades\URL; use Spatie\Activitylog\Traits\LogsActivity; class ProjectCrew extends BaseModel implements ModelSurveyContract { use PresentableTrait, LogsActivity, ModelSurveyTrait; protected $table = 'pp_project_crew'; /** * Model configuration. * @var string */ public $config = 'projectPlan.models.projectCrew'; protected $casts = [ 'properties' => 'json', 'is_notified' => 'boolean' ]; protected $guarded = ['id']; public function project() { return $this->belongsTo(Project::class); } public function crew() { return $this->belongsTo(User::class, 'user_id'); } public function getPositionLabelAttribute() { $lov = ListOfValue::query()->where('code', $this->position_code)->first(); return optional($lov)->label ?? $this->position_code; } public function getSubmissionUser() { return $this->crew; } public function getSurveySignedUrl() { return URL::signedRoute('ppSubmitSurvey', ['project_crew' => $this->hashed_id]); } }