app/Http/Controllers/KabupatenController.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)
    {
        $this->validate($request, [
			'label' => 'required',
			'kode' => 'required',
		]);
        $data = new kabupaten();
		$data->uuid = Uuid::uuid4()->getHex();
		$data->label = $request->label;
		$data->kode = $request->kode;
		$data->save();
		return redirect()->route('kabupaten.index')->with('success', 'data successfully added');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'label' => 'required' , 'kode' => 'required' , ] ) ; $ data = new kabupaten ( ) ; $ data -> uuid = Uuid :: uuid4 ( ) -> getHex ( ) ; $ data -> label = $ request -> label ; $ data -> kode = $ request -> kode ; $ data -> save ( ) ; return redirect ( ) -> route ( 'kabupaten.index' ) -> with ( 'success' , 'data successfully added' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .