(master-data) card adat
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user