public function store(Request $request) { $a = new Crud(); $a->username = $request->username; $a->password = $request->password; $a->nama = $request->nama; $a->alamat = $request->alamat; $a->email = $request->email; $a->save(); Session::flash('info', 'Berhasil'); return redirect('crud'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $crud = Crud::all(); return View('crud.index', compact('crud')); }
public function destroy($id) { return Crud::destroy($id); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $crud = Crud::findOrFail($id); $crud->delete(); Session::flash('flash_message', 'Deleted successfully!'); return redirect()->route('crud.index'); }