...
This commit is contained in:
commit
d0e8cd7139
6 changed files with 53030 additions and 9 deletions
|
|
@ -134,7 +134,18 @@ class TippsController extends Controller
|
|||
]);
|
||||
|
||||
$user=Auth::user();
|
||||
|
||||
if ( is_null($user) ) {
|
||||
Log::info("TippsController.store: No authenticated user detected. Aborting storage command.");
|
||||
$tippLink="/tipps#";
|
||||
$r=\App\Round::getFirstTippableRound();
|
||||
if($r) $tippLink=$tippLink.$r->id;
|
||||
|
||||
// Redirect to the Rounds Index
|
||||
return redirect($tippLink);
|
||||
}
|
||||
Log::info("TippsController::store for user-id ".$user->id);
|
||||
|
||||
// Fetch, modify, save Tipp
|
||||
$tipp = Tipp::where('id', request('id'))->first();
|
||||
$game = Game::where('id', $tipp->game_id)->first();
|
||||
|
|
@ -207,7 +218,11 @@ class TippsController extends Controller
|
|||
// If one fails, previous saves are kept, but user
|
||||
// is redirected to edit4 page again.
|
||||
public function store4() {
|
||||
Log::debug("### Store4 ###");
|
||||
error_log("--- Store4 ---");
|
||||
// Validate form
|
||||
|
||||
//dd(request());
|
||||
$this->validate(request(), [
|
||||
'round_id' => 'required',
|
||||
'game_id_1' => 'required',
|
||||
|
|
@ -225,9 +240,9 @@ class TippsController extends Controller
|
|||
'score2_1' => 'required',
|
||||
'score2_2' => 'required',
|
||||
'score2_3' => 'required',
|
||||
'score2_4' => 'required',
|
||||
'round_id' => 'required'
|
||||
'score2_4' => 'required'
|
||||
]);
|
||||
error_log("Validation passed.");
|
||||
|
||||
$round_id= request('round_id');
|
||||
$game_id_1=request('game_id_1');
|
||||
|
|
@ -288,7 +303,13 @@ class TippsController extends Controller
|
|||
|
||||
}
|
||||
|
||||
return redirect('/tipps/');
|
||||
$tippLink="/tipps#";
|
||||
$r=\App\Round::getFirstTippableRound();
|
||||
if($r) $tippLink=$tippLink.$r->id;
|
||||
|
||||
// Redirect to the Rounds Index
|
||||
return redirect($tippLink);
|
||||
|
||||
}
|
||||
|
||||
// Store tipp if valid.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue