From a9582aab73bf644fe19f3c8c1081cd69de8430e5 Mon Sep 17 00:00:00 2001 From: wahyu Date: Thu, 14 Sep 2023 14:11:17 +0700 Subject: [PATCH] fix endline --- app/Models/AssignMaterial.php | 92 +++++++++++++++++------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/app/Models/AssignMaterial.php b/app/Models/AssignMaterial.php index 0c282a6..09620ee 100644 --- a/app/Models/AssignMaterial.php +++ b/app/Models/AssignMaterial.php @@ -1,46 +1,46 @@ - 'integer', - 'budget' => 'string', - ]; - - public static function boot() { - parent::boot(); - - static::created(function($data) { - $activity = Activity::find($data->activity_id); - $material = RequestMaterial::where("id", $data->material_id)->first(); - $activity->rencana_biaya += floatval($material->price) * floatval($data->qty_planning); - $activity->save(); - }); - - static::deleted(function($data) { - $reportActivities = ReportActivityMaterial::where('assign_material_id', $data->id)->delete(); - $activity = Activity::where('id', $data->activity_id)->first(); - $activity->rencana_biaya -= floatval($data->budget) * floatval($data->qty_planning); - $activity->save(); - }); - - } -} + 'integer', + 'budget' => 'string', + ]; + + public static function boot() { + parent::boot(); + + static::created(function($data) { + $activity = Activity::find($data->activity_id); + $material = RequestMaterial::where("id", $data->material_id)->first(); + $activity->rencana_biaya += floatval($material->price) * floatval($data->qty_planning); + $activity->save(); + }); + + static::deleted(function($data) { + $reportActivities = ReportActivityMaterial::where('assign_material_id', $data->id)->delete(); + $activity = Activity::where('id', $data->activity_id)->first(); + $activity->rencana_biaya -= floatval($data->budget) * floatval($data->qty_planning); + $activity->save(); + }); + + } +}