public function getTambah(Request $request) { /* Validasi */ $this->validate($request, ['nama' => 'required']); $vb = JenisUsaha::where('nama', $request->nama)->count(); if ($vb > 0) { return redirect()->route('jenis_usaha')->with(session()->flash('gagal', 'Data Sudah ada !!')); } /* end validasi */ $dt = new JenisUsaha(); $dt->nama = $request->nama; $dt->kelompok_bidang = $request->kelompok_bidang; $dt->save(); return redirect()->route('jenis_usaha')->with(session()->flash('success', 'Data Berhasil Tersimpan !!')); }