Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  * @param type User $user
  * @param type Sys_userRequest $request
  * @return type Response
  */
 public function store(CannedRequest $request, Canned $canned)
 {
     $canned->user_id = \Auth::user()->id;
     $canned->title = $request->input('title');
     $canned->message = $request->input('message');
     $canned->save();
     return redirect()->route('canned.list')->with('success', 'Added Successfully');
 }
Ejemplo n.º 2
0
 /**
  * Store a newly created Canned Response.
  * @param type CannedRequest $request 
  * @param type Canned $canned 
  * @return type Redirect
  */
 public function store(CannedRequest $request, Canned $canned)
 {
     // fetching all the requested inputs
     $canned->user_id = \Auth::user()->id;
     $canned->title = $request->input('title');
     $canned->message = $request->input('message');
     try {
         // saving inputs
         $canned->save();
         return redirect()->route('canned.list')->with('success', 'Added Successfully');
     } catch (Exception $e) {
         return redirect()->route('canned.list')->with('fails', $e->errorInfo[2]);
     }
 }