'array', 'rms_end_latlng' => 'array' ]; protected $hidden = ['pivot']; /** * Get all of the project's files. */ public function files() { return $this->morphMany('App\Models\ProjectFile', 'project_fileable'); } public function problemHistories() { return $this->hasMany('App\Models\RoadObservedHistory', 'problem_id'); } public function province() { return $this->belongsTo('App\Models\Province', 'rms_province_id'); } public function city() { return $this->belongsTo('App\Models\City', 'rms_city_id'); } public function edarateShahri() { return $this->belongsTo('App\Models\EdarateShahri', 'edarate_shahri_id'); } protected function imageAfter(): Attribute { return Attribute::make( get: fn($value) => $value == null ? null : (filter_var($value, FILTER_VALIDATE_URL) ? $value : Storage::disk('public')->url($value)) ); } protected function imageBefore(): Attribute { return Attribute::make( get: fn($value) => $value == null ? null : (filter_var($value, FILTER_VALIDATE_URL) ? $value : Storage::disk('public')->url($value)) ); } public function missions(): MorphToMany { return $this->morphToMany(Mission::class, 'missionable', 'missionables', 'missionable_id', 'mission_id', ); } public function nikarayanFaults(): HasMany { return $this->hasMany(NikarayanFault::class); } }