user()->addActivityComplete(1020,$model); }); self::updating(function($model){ auth()->user()->addActivityComplete(1021,$model); }); self::updated(function($model){ }); self::deleting(function($model){ auth()->user()->addActivityComplete(1022,$model); }); self::deleted(function($model){ }); } /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'province_name', 'city_name', 'province_id', 'city_id', 'name', 'status', 'type', 'type_fa', 'team_num', 'staff_num', 'phone', 'responsible_name', 'responsible_mobile', 'successor_name', 'successor_mobile', 'machines_light', 'machines_sheavy', 'machines_heavy', 'code', 'lat', 'lng', 'lat_from', 'lng_from', 'geometry', 'color', 'lat_to', 'lng_to', 'updated_at_fa', ]; public function files(): MorphMany { return $this->morphMany('App\Models\PointFile', 'point_fileable'); } public function rahdariPointHistories(): HasMany { return $this->hasMany('App\Models\RahdariPointHistory', 'point_id'); } protected function area(): Attribute { return Attribute::make( get: fn($value) => json_decode($value) ); } }