29 lines
895 B
PHP
29 lines
895 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Judging;
|
|
|
|
use App\Actions\Tabulation\EnterBonusScore;
|
|
use App\Exceptions\ScoreEntryException;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Entry;
|
|
use Illuminate\Support\Facades\App;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class BonusScoreRecordController extends Controller
|
|
{
|
|
public function __invoke(Entry $entry)
|
|
{
|
|
$enterBonusScore = App::make(EnterBonusScore::class);
|
|
$validData = request()->validate([
|
|
'score' => 'required|integer',
|
|
]);
|
|
try {
|
|
$enterBonusScore(Auth::user(), $entry, $validData['score']);
|
|
} catch (ScoreEntryException $ex) {
|
|
return redirect()->back()->with('error', 'Score Entry Error - '.$ex->getMessage());
|
|
}
|
|
|
|
return redirect()->route('judging.bonusScore.EntryList', $entry->audition)->with('Score Recorded Successfully');
|
|
}
|
|
}
|