get(); return view('admin.permission.index',$data); } public function store(Request $request){ $this->validate($request,[ 'name' => 'required|unique:permissions,name', 'display_name' => 'required', ]); $permission = new Permission(); $permission->name = $request->name; $permission->display_name = $request->display_name; $permission->save(); return back()->with('msg','Data Insert Successful !'); } public function edit($id){ $data['title'] = "Permission Edit"; $data['permissions'] = Permission::find($id); return view('admin.permission.edit',$data); } public function update(Request $request,$id){ $this->validate($request,[ 'name' => 'required', 'display_name' => 'required', ]); $permission =Permission::find($id); $permission->name = $request->name; $permission->display_name = $request->display_name; $permission->update(); return redirect('admin/permissions')->with('msg','Data Update Successful !'); } public function destroy($id){ Permission::whereId($id)->delete(); return back()->with('msg','Data Delete Successful !'); } }