Update AuditionSettings.php
This commit is contained in:
parent
5ac72c2301
commit
40c0300180
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin;
|
|||
use App\Http\Controllers\Controller;
|
||||
use App\Settings;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use function to_route;
|
||||
|
||||
class AuditionSettings extends Controller
|
||||
|
|
@ -27,15 +28,17 @@ class AuditionSettings extends Controller
|
|||
'school_fee' => ['nullable', 'numeric', 'min:0'],
|
||||
]);
|
||||
|
||||
// Olympic Scoring Switch
|
||||
$validData['olympic_scoring'] = $request->get('olympic_scoring') == '1';
|
||||
|
||||
// Store currency values as cents
|
||||
$validData['late_fee'] = $validData['late_fee'] * 100;
|
||||
$validData['school_fee'] = $validData['school_fee'] * 100;
|
||||
|
||||
// TODO implement olympic scoring
|
||||
foreach ($validData as $key => $value) {
|
||||
Settings::set($key, $value);
|
||||
}
|
||||
|
||||
Cache::flush();
|
||||
return to_route('audition-settings')->with('success', 'Settings Saved');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue