/** * Store a newly created resource in storage. * @param type Groups $group * @param type GroupRequest $request * @return type Response */ public function store(Groups $group, GroupRequest $request) { try { /* Check Whether function success or not */ $group->fill($request->input())->save(); return redirect('groups')->with('success', 'Group Created Successfully'); } catch (Exception $e) { /* redirect to Index page with Fails Message */ return redirect('groups')->with('fails', 'Groups can not Create' . '<li>' . $e->errorInfo[2] . '</li>'); } }
/** * Store a newly created resource in storage. * @param type Groups $group * @param type GroupRequest $request * @return type Response */ public function store(Groups $group, GroupRequest $request) { try { /* Check Whether function success or not */ if ($group->fill($request->input())->save() == true) { /* redirect to Index page with Success Message */ return redirect('groups')->with('success', 'Groups Created Successfully'); } else { /* redirect to Index page with Fails Message */ return redirect('groups')->with('fails', 'Groups can not Create'); } } catch (Exception $e) { /* redirect to Index page with Fails Message */ return redirect('groups')->with('fails', 'Groups can not Create'); } }