app/Http/Controllers/UsahaController.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, [
			'nama_usaha' => 'required',
			'nama_pemilik' => 'required',
			'nomor_izin_usaha' => 'required',
			'alamat' => 'required',
			'jenis_usaha' => 'required',
			'jml_tkerja' => 'required',
			'modal' => 'required',
			'omzet_bln' => 'required',
			'omzet_thn' => 'required',
			'telpon' => 'required',
			'kategori' => 'required',
			'lat' => 'required',
			'lng' => 'required',
		]);
		$usaha = new Usaha();
		$usaha->uuid = Uuid::uuid4()->getHex();
		$usaha->nama_usaha = $request->nama_usaha;
		$usaha->nama_pemilik = $request->nama_pemilik;
		$usaha->nomor_izin_usaha = $request->nomor_izin_usaha;
		$usaha->alamat = $request->alamat;
		$usaha->jenis_usaha = $request->jenis_usaha;
		$usaha->jml_tkerja = $request->jml_tkerja;
		$usaha->modal = $request->modal;
		$usaha->omzet_bln = $request->omzet_bln;
		$usaha->omzet_thn = $request->omzet_thn;
		$usaha->telpon = $request->telpon;
		$usaha->kategori = $request->kategori;
		$usaha->lat = $request->lat;
		$usaha->lng = $request->lng;
		$usaha->save();
		return redirect()->route('usaha.index')->with('success', 'data successfully added');
	}
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'nama_usaha' => 'required' , 'nama_pemilik' => 'required' , 'nomor_izin_usaha' => 'required' , 'alamat' => 'required' , 'jenis_usaha' => 'required' , 'jml_tkerja' => 'required' , 'modal' => 'required' , 'omzet_bln' => 'required' , 'omzet_thn' => 'required' , 'telpon' => 'required' , 'kategori' => 'required' , 'lat' => 'required' , 'lng' => 'required' , ] ) ; $ usaha = new Usaha ( ) ; $ usaha -> uuid = Uuid :: uuid4 ( ) -> getHex ( ) ; $ usaha -> nama_usaha = $ request -> nama_usaha ; $ usaha -> nama_pemilik = $ request -> nama_pemilik ; $ usaha -> nomor_izin_usaha = $ request -> nomor_izin_usaha ; $ usaha -> alamat = $ request -> alamat ; $ usaha -> jenis_usaha = $ request -> jenis_usaha ; $ usaha -> jml_tkerja = $ request -> jml_tkerja ; $ usaha -> modal = $ request -> modal ; $ usaha -> omzet_bln = $ request -> omzet_bln ; $ usaha -> omzet_thn = $ request -> omzet_thn ; $ usaha -> telpon = $ request -> telpon ; $ usaha -> kategori = $ request -> kategori ; $ usaha -> lat = $ request -> lat ; $ usaha -> lng = $ request -> lng ; $ usaha -> save ( ) ; return redirect ( ) -> route ( 'usaha.index' ) -> with ( 'success' , 'data successfully added' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// dd($request);