Skip to content

Commit b92c02d

Browse files
committed
Remove global scope and filterable field for 'daftarSp2d' in KerangkaAcuan: Simplify model and UI components
1 parent f929187 commit b92c02d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app/Models/KerangkaAcuan.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public function spesifikasiKerangkaAcuan(): HasMany
5353

5454
protected static function booted(): void
5555
{
56-
static::addGlobalScope('with-daftar-sp2d-count', function (Builder $builder) {
57-
$builder->withCount('daftarSp2d');
58-
});
56+
// static::addGlobalScope('with-daftar-sp2d-count', function (Builder $builder) {
57+
// $builder->withCount('daftarSp2d');
58+
// });
5959

6060
static::creating(function (KerangkaAcuan $kak) {
6161
$kak->status = 'dibuat';

app/Nova/KerangkaAcuan.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ public function fields(NovaRequest $request)
124124
->options(Helper::setOptionDipa())
125125
->default(Helper::getPropertyFromCollection(Dipa::cache()->get('all')->where('tahun', session('year'))->first(), 'id')),
126126
]),
127-
Select::make('SP2D', 'daftar_sp2d_count')
128-
->options([
129-
0 => 'Tidak Ada',
130-
])
131-
->filterable(function ($request, $query, $value, $attribute) {
132-
$query->has('daftarSp2d', '<=', $value);
133-
})
134-
->onlyOnDetail(),
127+
// Select::make('SP2D', 'daftar_sp2d_count')
128+
// ->options([
129+
// 0 => 'Tidak Ada',
130+
// ])
131+
// ->filterable(function ($request, $query, $value, $attribute) {
132+
// $query->has('daftarSp2d', '<=', $value);
133+
// })
134+
// ->onlyOnDetail(),
135135
BelongsToMany::make('SP2D', 'daftarSp2d', 'App\Nova\DaftarSp2d'),
136136
Tabs::make('Detail', [
137137
HasMany::make('Anggaran', 'anggaranKerangkaAcuan', 'App\Nova\AnggaranKerangkaAcuan'),

0 commit comments

Comments
 (0)