mirror of
https://github.com/flarum/core.git
synced 2025-10-18 10:16:09 +02:00
Implement user preferences API
Preferences must be registered (optionally with a callback to transform data, and a default value) on the User model.
This commit is contained in:
@@ -37,6 +37,11 @@ class EditUserCommandHandler
|
||||
if (! empty($command->readTime)) {
|
||||
$userToEdit->markAllAsRead();
|
||||
}
|
||||
if (! empty($command->preferences)) {
|
||||
foreach ($command->preferences as $k => $v) {
|
||||
$userToEdit->setPreference($k, $v);
|
||||
}
|
||||
}
|
||||
|
||||
event(new UserWillBeSaved($userToEdit, $command));
|
||||
|
||||
|
Reference in New Issue
Block a user