I can't figure out why this isn't working. I checked all the fields in the object and they are being changed fine. The function completes without errors and the Session::flash gets changed but the save is not updating the database. Any help would be great.
public function confirmLeague($id, $authToken)
{
$league = League::find($id);
if ($league == null || $league->AuthToken != $authToken || $league->Validated)
{
Session::flash('error', 'The league does not exist.');
return redirect('/');
}
$league->Validated = true;
$league->save();
Session::flash('success', 'The league has been added.');
return redirect('/');
}
Table script:
Schema::create('leagues', function (Blueprint $table) {
$table->increments('Id');
$table->string('LeagueName', 250);
$table->string('City', 50);
$table->string('Province', 50);
$table->string('Sport', 50);
$table->string('Type', 10);
$table->string('Website')->nullable();
$table->string('Person', 100);
$table->string('Phone', 20);
$table->string('Email', 100);
$table->string('Description', 250)->default('');
$table->boolean('Validated')->default(FALSE);
});