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.
 
 
 
 

18 lines
386 B

<?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;
}
}