Enter Round report (display for regular players still pending)
This commit is contained in:
parent
30248ae4ef
commit
09b75172d8
4 changed files with 80 additions and 31 deletions
|
|
@ -9,6 +9,7 @@ use App\Game;
|
|||
use App\User;
|
||||
use DB;
|
||||
use Auth;
|
||||
use Log;
|
||||
|
||||
class RoundsController extends Controller
|
||||
{
|
||||
|
|
@ -107,6 +108,34 @@ class RoundsController extends Controller
|
|||
return redirect('/rounds');
|
||||
}
|
||||
|
||||
public function store_report() {
|
||||
if (Auth::guest()) { return redirect("/"); }
|
||||
if (!Auth::user()->admin) { return redirect("/"); }
|
||||
|
||||
// Validate form
|
||||
$this->validate(request(), [
|
||||
'round_id' => 'required',
|
||||
'report' => 'required'
|
||||
]);
|
||||
|
||||
$seasonId = Season::getCurrent()->id;
|
||||
|
||||
$round = Round::where('id','=',request('round_id'))->first();
|
||||
|
||||
//Log::info("Report = ".request("report"));
|
||||
|
||||
|
||||
$round->report = request("report");
|
||||
$round->save();
|
||||
|
||||
|
||||
// Redirect to the home page
|
||||
return redirect('/rounds');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function editname($round_id)
|
||||
{
|
||||
$round = Round::where('id', $round_id)->first();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue