'date', 'planned_end_date' => 'date', 'actual_start_date' => 'date', 'actual_end_date' => 'date', 'estimated_cost' => 'integer', 'actual_cost' => 'integer', 'shutdown_required' => 'boolean', 'commissioning_required' => 'boolean', 'attachments' => 'array', ]; public function business() { return $this->belongsTo(Business::class); } public function project() { return $this->belongsTo(\Modules\Project\Entities\Project::class, 'project_id'); } public function productionLine() { return $this->belongsTo(ProductionLine::class, 'production_line_id'); } public function supervisor() { return $this->belongsTo(User::class, 'supervisor_id'); } public function phases() { return $this->hasMany(RebuildPhase::class, 'rebuild_project_id')->orderBy('sort_order'); } public function equipmentItems() { return $this->belongsToMany(Equipment::class, 'maintenance_rebuild_equipment', 'rebuild_project_id', 'equipment_id') ->withPivot(['pre_rebuild_health', 'post_rebuild_health', 'status']) ->withTimestamps(); } public function workOrders() { return $this->hasMany(WorkOrder::class, 'rebuild_id'); } }