flarum-users-map-location/src/Listeners/AddLocationAttribute.php

19 lines
386 B
PHP
Raw Normal View History

2022-02-05 14:45:41 +00:00
<?php
namespace Justoverclock\UsersMapLocation\Listeners;
use Flarum\Api\Serializer\UserSerializer;
use Flarum\User\User;
class AddLocationAttribute
{
public function __invoke(UserSerializer $serializer, User $user, array $attributes): array
{
$actor = $serializer->getActor();
$attributes['location'] = $user->location;
return $attributes;
}
}