user()->addActivityComplete(1118); }); self::updating(function($model){ }); self::updated(function($model){ }); self::deleting(function($model){ auth()->user()->addActivityComplete(1120,$model); }); self::deleted(function($model){ }); } public function histories() { return $this->hasMany(DailyAccidentHistory::class, 'subject_id', 'id'); } public function setAxisDirectionFa($id) { if ($id == '1') { $direction_fa = 'رفت'; } elseif ($id == '2') { $direction_fa = 'برگشت'; } $this->attributes['direction_fa'] = $direction_fa; } public function setWeatherConditionFa($id) { if ($id == '1') { $weather_condition_fa = 'برفی'; } elseif ($id == '2') { $weather_condition_fa = 'کولاک'; } elseif ($id == '3') { $weather_condition_fa = 'آفتابی'; } elseif ($id == '4') { $weather_condition_fa = 'بارانی'; } elseif ($id == '5') { $weather_condition_fa = 'یخبندان'; } elseif ($id == '6') { $weather_condition_fa = 'مه آلود'; } $this->attributes['weather_condition_fa'] = $weather_condition_fa; } public function setWayGeometriFa($id) { if ($id == '1') { $way_geometri_fa = "تقاطع - دسترسی"; } elseif ($id == '2') { $way_geometri_fa = "قوس افقی یا قائم"; } elseif ($id == '3') { $way_geometri_fa = "پل"; } elseif ($id == '4') { $way_geometri_fa = "پل و قوس"; } elseif ($id == '5') { $way_geometri_fa = "تونل"; } elseif ($id == '6') { $way_geometri_fa = "میدان"; } elseif ($id == '7') { $way_geometri_fa = "دوربرگردان"; } elseif ($id == '8') { $way_geometri_fa = "بریدگی"; } elseif ($id == '9') { $way_geometri_fa = "تقاطع و قوس"; } elseif ($id == '10') { $way_geometri_fa = "نقطه عادی"; } $this->attributes['way_geometri_fa'] = $way_geometri_fa; } }