Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/Models/Dipa.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Models;

use App\Models\KamusAnggaran;
use App\Models\MataAnggaran;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
Expand Down Expand Up @@ -47,8 +45,8 @@ public static function cacheEntities(): array
protected static function booted(): void
{
static::deleting(function (Dipa $dipa) {
MataAnggaran::where('dipa_id', $dipa->id)->delete();
KamusAnggaran::where('dipa_id', $dipa->id)->delete();
MataAnggaran::where('dipa_id', $dipa->id)->delete();
KamusAnggaran::where('dipa_id', $dipa->id)->delete();
});
}
}
5 changes: 2 additions & 3 deletions app/Models/HargaSatuan.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Models;

use App\Models\JenisKontrak;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
Expand Down Expand Up @@ -38,8 +37,8 @@ public static function cacheEntities(): array
protected static function booted(): void
{
static::deleting(function (HargaSatuan $harga_satuan) {
$jenisKontrakIds = JenisKontrak::where('harga_satuan_id', $harga_satuan->id)->pluck('id');
JenisKontrak::destroy($jenisKontrakIds);
$jenisKontrakIds = JenisKontrak::where('harga_satuan_id', $harga_satuan->id)->pluck('id');
JenisKontrak::destroy($jenisKontrakIds);
});
}
}
1 change: 0 additions & 1 deletion app/Models/KamusAnggaran.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ public static function cacheEntities(): array
}),
];
}

}
2 changes: 0 additions & 2 deletions app/Models/KerangkaAcuan.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@ protected static function booted(): void
$copyAnggaran = $anggaran->replicate();
$copyAnggaran->kerangka_acuan_id = $kak->id;
$copyAnggaran->save();

}
$spesifikasis = SpesifikasiKerangkaAcuan::where('kerangka_acuan_id', $request->input('fromResourceId'))->get();
foreach ($spesifikasis as $spesifikasi) {
$copySpesifikasi = $spesifikasi->replicate();
$copySpesifikasi->kerangka_acuan_id = $kak->id;
$copySpesifikasi->save();

}
});
});
Expand Down