Add dark mode [db]

This commit is contained in:
2018-08-06 08:01:00 +02:00
parent fabc3ad24e
commit 9fd6890667
17 changed files with 117 additions and 10 deletions
@@ -38,6 +38,7 @@ class AccountController extends Controller
Rule::unique('users')->ignoreModel($user),
],
'new_password' => ['nullable', 'confirmed', VALI_PASSWORD],
'dark_mode' => 'nullable',
]);
if ($input->email != $user->email) {
+2 -1
View File
@@ -33,6 +33,7 @@ use MightyPork\Utils\Str;
* @property string $email - unique, for login and social auth chaining
* @property string $password - hashed pw
* @property bool $confirmed - user e-mail is confirmed
* @property bool $dark_mode - user prefers dark mode
* @property-read Proposal[]|Collection $proposals
* @property-read Table[]|Collection $tables
* @property-read OAuthIdentity[]|Collection $socialIdentities
@@ -62,7 +63,7 @@ class User extends BaseModel implements
* @var array
*/
protected $fillable = [
'name', 'title', 'email', 'password', 'bio', 'website', 'confirmed'
'name', 'title', 'email', 'password', 'bio', 'website', 'confirmed', 'dark_mode'
];
/**
+4
View File
@@ -32,6 +32,10 @@ function faker() {
return $fac = Faker\Factory::create();
}
function dark_mode() {
return user() !== NULL && user()->dark_mode;
}
/**
* Recursively expand validation rules
*