<?php

namespace App\Http\Controllers;

use App\Models\data_distrik_bumdes;
use App\Http\Requests\Storedata_distrik_bumdesRequest;
use App\Http\Requests\Updatedata_distrik_bumdesRequest;

class DataDistrikBumdesController extends Controller
{
    /**
     * Display a listing of the resource.
     */
    public function index()
    {
        $data_distrik=data_distrik_bumdes::all();
        return view('BumDes.data-distrik',compact('data_distrik'));
    }

    /**
     * Show the form for creating a new resource.
     */
    public function create()
    {
        return view('BumDes.data-distrik',[
            'data-distrik'=>data_distrik_bumdes::all()
        ]);
    }

    /**
     * Store a newly created resource in storage.
     */
    public function store(Storedata_distrik_bumdesRequest $request)
    {
        $validateData=$request->validate([
            'nama_distrik'=>'required',
            'jumlah_kampung'=>'required',
            'jumlah_penduduk'=>'required'
        ]);
        data_distrik_bumdes::create($validateData);
        return redirect('bumdes-data-bumdes');
    }

    /**
     * Display the specified resource.
     */
    public function show(data_distrik_bumdes $data_distrik_bumdes)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     */
    public function edit(data_distrik_bumdes $data_distrik_bumdes)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     */
    public function update(Updatedata_distrik_bumdesRequest $request, data_distrik_bumdes $data_distrik_bumdes)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     */
    public function destroy(data_distrik_bumdes $data_distrik_bumdes)
    {
        //
    }
}