Created
August 6, 2024 09:07
-
-
Save luceos/9c58e073a34333ca16b5fbcfcb18a205 to your computer and use it in GitHub Desktop.
setting specific preferences for new users when they register
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Flarum\Extend; | |
return [ | |
(new Extend\Event) | |
->listen(\Flarum\User\Event\Registered::class, function (\Flarum\User\Event\Registered $event) { | |
$event->user->setPreference('discloseOnline', true); | |
$event->user->setPreference('indexProfile', true); | |
}), | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment