app/Http/Controllers/KecamatanController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request, $uuid)
    {
        $this->validate($request, [
            'label' => 'required',
        ]);
        $data = new Kecamatan();
        $data->id_kabupaten = $uuid;
        $data->uuid = Uuid::uuid4()->getHex();
        $data->label = $request->label;
        $data->save();
        return redirect()->route('kabupaten.kecamatan.index', $uuid)->with('success', 'data successfully added');
    }
public function store ( Request $ request , $ uuid ) { $ this -> validate ( $ request , [ 'label' => 'required' , ] ) ; $ data = new Kecamatan ( ) ; $ data -> id_kabupaten = $ uuid ; $ data -> uuid = Uuid :: uuid4 ( ) -> getHex ( ) ; $ data -> label = $ request -> label ; $ data -> save ( ) ; return redirect ( ) -> route ( 'kabupaten.kecamatan.index' , $ uuid ) -> with ( 'success' , 'data successfully added' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .