(master-data) card adat

This commit is contained in:
2026-04-30 15:36:56 +07:00
parent 16f459c6e1
commit ab650fc25e
2 changed files with 27 additions and 2 deletions
@@ -18,6 +18,9 @@ class AdatController extends Controller
$provinsi = Provinsi::orderBy('kode', 'asc')->get();
$totalAdat = Adat::count();
$totalDesa = Adat::distinct('desa_kelurahan_id')->count('desa_kelurahan_id');
$adat = Adat::with('desakelurahan')
->where('nama', 'like', "%$search%")
->orWhereHas('desakelurahan', function($query) use ($search) {
@@ -26,12 +29,12 @@ class AdatController extends Controller
->orderBy('nama', 'asc')
->paginate($perPage);
return view('master.adat.index', compact('title', 'adat', 'provinsi'));
return view('master.adat.index', compact('title', 'adat', 'provinsi', 'totalAdat', 'totalDesa'));
}
public function adatByDesa($adat_id)
{
$adat = Adat::where('desa_kelurahan_id', $desa_id)
$adat = Adat::where('desa_kelurahan_id', $adat_id)
->orderBy('nama', 'asc')
->get();