Add dark mode [db]
This commit is contained in:
@@ -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
@@ -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'
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,10 @@ function faker() {
|
||||
return $fac = Faker\Factory::create();
|
||||
}
|
||||
|
||||
function dark_mode() {
|
||||
return user() !== NULL && user()->dark_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively expand validation rules
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user