Add setting for weekly_report column
MODIFY
app/Http/Controllers/SettingsController.php
app/Http/Controllers/SettingsController.php
@@ -23,7 +23,8 @@ class SettingsController extends Controller {
'avatar' => 'nullable|mimes:jpeg,jpg,png,gif',
'password' => 'nullable|confirmed',
'language' => 'required|in:' . implode(',', array_keys(config('app.locales'))),
- 'theme' => 'required|in:light,dark'
+ 'theme' => 'required|in:light,dark',
+ 'weekly_report' => 'required|in:true,false'
]);
$user = Auth::user();
@@ -50,6 +51,7 @@ class SettingsController extends Controller {
$user->language = $request->input('language');
$user->theme = $request->input('theme');
+ $user->weekly_report = $request->input('weekly_report') == 'true' ? true : false;
$user->save();

MODIFY
resources/views/settings.blade.php
resources/views/settings.blade.php
</select>
@include('partials.validation_error', ['payload' => 'language'])
</div>
- <div class="input input--small mb-0">
+ <div class="input input--small">
<label>{{ __('general.theme') }}</label>
<select name="theme">
<option value="light" {{ Auth::user()->theme == 'light' ? 'selected' : '' }}>Light</option>
</select>
@include('partials.validation_error', ['payload' => 'theme'])
</div>
+ <div class="input input--small mb-0">
+ <label>Weekly Report</label>
+ <div>
+ <input type="radio" name="weekly_report" value="true" {{ Auth::user()->weekly_report ? 'checked' : '' }} /> Yes
+ </div>
+ <div>
+ <input type="radio" name="weekly_report" value="false" {{ Auth::user()->weekly_report ? '' : 'checked' }} /> No
+ </div>
+ @include('partials.validation_error', ['payload' => 'weekly_report'])
+ </div>
</div>
</div>
<div class="box__section box__section--highlight text-right">

Add setting for weekly_report column