Skip to content

Commit

Permalink
Add default value for game start_date
Browse files Browse the repository at this point in the history
  • Loading branch information
joeke committed Oct 15, 2024
1 parent 19bc146 commit 1573acb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/GameController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Models\Game;
use App\Models\GameType;
use App\Models\User;
use Carbon\Carbon;

class GameController extends Controller
{
Expand Down Expand Up @@ -62,7 +63,7 @@ public function store(Request $request): RedirectResponse
'player_id' => $request->player_id ?? $request->user()->id,
'opponent_id' => $request->opponent_id,
'score_goal' => $request->score_goal,
'start_date' => $request->start_date,
'start_date' => $request->start_date ?? Carbon::now(),
'end_date' => $request->end_date,
'created_by' => $request->user()->id
]);
Expand Down

0 comments on commit 1573acb

Please sign in to comment.