<?php

namespace App\Http\Controllers;

use App\Models\data_distrik_deswita;
use App\Http\Requests\Storedata_distrik_deswitaRequest;
use App\Http\Requests\Updatedata_distrik_deswitaRequest;

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

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

    /**
     * Store a newly created resource in storage.
     */
    public function store(Storedata_distrik_deswitaRequest $request)
    {
        $validateData=$request->validate([
            'nama_distrik'=>'required',
            'jumlah_kampung'=>'required',
            'jumlah_penduduk'=>'required'
        ]);
        data_distrik_deswita::create($validateData);

    }

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

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

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

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