JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrall(), [ 'module' => 'required|unique:webhooks,module,NULL,id,created_by,' . \Auth::user()->creatorId(), 'method' => 'required', 'url' => 'required|', ] ); if ($validator->fails()) { $messages = $validator->getMessageBag(); return redirect()->back()->with('error', $messages->first()); } $webhook = new Webhook(); $webhook->module = $request->module; $webhook->method = $request->method; $webhook->url = $request->url; $webhook->created_by = Auth::user()->creatorId(); $webhook->save(); return redirect()->back()->with('success' , __('Webhook setting created successfully')); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { // } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $webhook = Webhook::where('id', $id)->where('created_by', Auth::user()->id)->first(); $module = Webhook::$module; $method = Webhook::$method; return view('webhook.edit', compact('webhook','module','method')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $webhook['module'] = $request->module; $webhook['method'] = $request->method; $webhook['url'] = $request->url; $webhook['created_by'] = Auth::user()->creatorId(); Webhook::where('id', $id)->update($webhook); return redirect()->back()->with('success', __('Webhook Setting Succssfully Updated')); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $webhook = Webhook::find($id); if ($webhook) { $webhook->delete(); return redirect()->back()->with('success', __('Webhook Setting successfully deleted .')); } else { return redirect()->back()->with('error', __('Something is wrong.')); } } }