24 lines
745 B
PHP
24 lines
745 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Sampah;
|
|
use App\Models\KategoriTps;
|
|
use App\Models\LokasiTps;
|
|
use Illuminate\Http\Request;
|
|
|
|
class IndexController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
$sampah = Sampah::orderBy('tahun', 'desc')->first();
|
|
$kategoriTps = KategoriTps::orderBy('id_kategori_tps')->get();
|
|
$lokasiTps = LokasiTps::all();
|
|
$jumlahTps = LokasiTps::where('kategori_tps_id', '3')->count();
|
|
$jumlahTps3r = LokasiTps::where('kategori_tps_id', '5')->count();
|
|
$jumlahTpa = LokasiTps::where('kategori_tps_id', '6')->count();
|
|
|
|
return view('user.index', compact('sampah', 'kategoriTps', 'lokasiTps', 'jumlahTps', 'jumlahTps3r', 'jumlahTpa'));
|
|
}
|
|
}
|