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

2 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;
return $attributes;
}
}