You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
386 B

3 years ago
<?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;
3 years ago
return $attributes;
}
}