/home/techb158/ileadtechnology.com/app/Http/Controllers
Edit: /home/techb158/ileadtechnology.com/app/Http/Controllers/RefundPolicyController.php (2674B)
validate($request,[
'name'=>'required',
'days'=>'required',
'detail'=>'required',
]);
$input = $request->all();
$data = RefundPolicy::create($input);
Session::flash('success',trans('flash.AddedSuccessfully'));
return redirect('refundpolicy');
}
/**
* Display the specified resource.
*
* @param \App\RefundPolicy $refundPolicy
* @return \Illuminate\Http\Response
*/
public function show(RefundPolicy $refundPolicy)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\RefundPolicy $refundPolicy
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$return = RefundPolicy::where('id', $id)->first();
return view('admin.return_policy.edit',compact('return'));
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\RefundPolicy $refundPolicy
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$this -> validate($request,[
'name'=>'required',
'detail'=>'required',
]);
$data = RefundPolicy::findorfail($id);
$input = $request->all();
$data->update($input);
Session::flash('success',trans('flash.UpdatedSuccessfully'));
return redirect('refundpolicy');
}
/**
* Remove the specified resource from storage.
*
* @param \App\RefundPolicy $refundPolicy
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
RefundPolicy::where('id', $id)->delete();
return redirect('refundpolicy');
}
}