コード例 #1
0
 /**
  * Store a newly created resource in storage.
  * @param type Teams $team
  * @param type TeamRequest $request
  * @return type Response
  */
 public function store(Teams $team, TeamRequest $request)
 {
     try {
         /* Check whether function success or not */
         if ($team->fill($request->input())->save() == true) {
             /* redirect to Index page with Success Message */
             return redirect('teams')->with('success', 'Teams  Created Successfully');
         } else {
             /* redirect to Index page with Fails Message */
             return redirect('teams')->with('fails', 'Teams can not Create');
         }
     } catch (Exception $e) {
         /* redirect to Index page with Fails Message */
         return redirect('teams')->with('fails', 'Teams can not Create');
     }
 }