mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
added followAfterReply to core
This commit is contained in:
parent
6bdebfbf3c
commit
603367a41a
|
@ -10,6 +10,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Builder;
|
use Illuminate\Database\Schema\Builder;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'up' => function (Builder $builder) {
|
'up' => function (Builder $builder) {
|
||||||
|
@ -22,10 +23,10 @@ return [
|
||||||
->each(function ($user) use ($db) {
|
->each(function ($user) use ($db) {
|
||||||
collect(json_decode($user->preferences ?? '{}'))
|
collect(json_decode($user->preferences ?? '{}'))
|
||||||
->each(function ($value, $key) use ($user, $db) {
|
->each(function ($value, $key) use ($user, $db) {
|
||||||
if ($key === 'discloseOnline') {
|
if (in_array($key, ['discloseOnline', 'followAfterReply'])) {
|
||||||
$db->table('users')
|
$db->table('users')
|
||||||
->where('id', $user->id)
|
->where('id', $user->id)
|
||||||
->update(['disclose_online' => (bool) $value]);
|
->update([Str::snake($key) => (bool) $value]);
|
||||||
}
|
}
|
||||||
if ($key === 'locale') {
|
if ($key === 'locale') {
|
||||||
$db->table('users')
|
$db->table('users')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user