app/Http/Controllers/WilayahController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create(Request $req)
    {
        $req->validate([
            "wilayah"=>"required"
        ]);
        $wilayah = new wilayah;
        $wilayah->wilayah = $req->wilayah;
        $query = $wilayah->save();
        if ($query) {
            return redirect('admin/formwilayah');
        }else {
            return back('tambah_wilayah')->with('fail','data tidak berhasil ditambahkan');
        }
    }
public function create ( Request $ req ) { $ req -> validate ( [ " wilayah " => " required " ] ) ; $ wilayah = new wilayah ; $ wilayah -> wilayah = $ req -> wilayah ; $ query = $ wilayah -> save ( ) ; if ( $ query ) { return redirect ( 'admin/formwilayah' ) ; } else { return back ( 'tambah_wilayah' ) -> with ( 'fail' , 'data tidak berhasil ditambahkan' ) ; } }
Show the form for creating a new resource.
Show the form for creating a new resource .