コード例 #1
0
ファイル: TeamsController.php プロジェクト: bunsha/gazingle
 public function save(Request $request)
 {
     $team = Team::firstOrNew(['account_id' => $request->account]);
     $team->account_id = $request->account;
     $team->theData = json_encode($request->data);
     $team->save();
     return $team;
 }
コード例 #2
0
ファイル: TestsController.php プロジェクト: bunsha/gazingle
 public function saveTeam(Request $request)
 {
     if ($request->saved_id > 0) {
         $team = Team::where('id', $request->saved_id)->last();
         $team->account_id = $request->account;
         $team->theData = json_encode($request->data);
     } else {
         $team = Team::firstOrNew(['account_id' => $request->account]);
         $team->account_id = $request->account;
         $team->theData = json_encode($request->data);
     }
     $team->save();
     return $request->data;
 }