/** * Store a newly created resource in storage. * @param type Help_topic $topic * @param type HelptopicRequest $request * @return type Response */ public function store(Help_topic $topic, HelptopicRequest $request) { try { /* Check whether function success or not */ if ($topic->fill($request->input())->save() == true) { /* redirect to Index page with Success Message */ return redirect('helptopic')->with('success', 'Helptopic Created Successfully'); } else { /* redirect to Index page with Fails Message */ return redirect('helptopic')->with('fails', 'Helptopic can not Create'); } } catch (Exception $e) { /* redirect to Index page with Fails Message */ return redirect('helptopic')->with('fails', 'Helptopic can not Create'); } }
/** * Store a newly created resource in storage. * @param type Help_topic $topic * @param type HelptopicRequest $request * @return type Response */ public function store(Help_topic $topic, HelptopicRequest $request) { try { if ($request->custom_form) { $custom_form = $request->custom_form; } else { $custom_form = null; } if ($request->auto_assign) { $auto_assign = $request->auto_assign; } else { $auto_assign = null; } /* Check whether function success or not */ $topic->fill($request->except('custom_form', 'auto_assign'))->save(); // $topics->fill($request->except('custom_form','auto_assign'))->save(); /* redirect to Index page with Success Message */ return redirect('helptopic')->with('success', 'Helptopic Created Successfully'); } catch (Exception $e) { /* redirect to Index page with Fails Message */ return redirect('helptopic')->with('fails', 'Helptopic can not Create' . '<li>' . $e->errorInfo[2] . '</li>'); } }