1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-25 17:26:43 +00:00
pixelfed/app/Transformer/Api/RelationshipTransformer.php
2019-01-27 19:40:36 -07:00

27 lines
687 B
PHP

<?php
namespace App\Transformer\Api;
use Auth;
use App\Profile;
use League\Fractal;
class RelationshipTransformer extends Fractal\TransformerAbstract
{
public function transform(Profile $profile)
{
$user = Auth::user()->profile;
return [
'id' => (string) $profile->id,
'following' => $user->follows($profile),
'followed_by' => $user->followedBy($profile),
'blocking' => null,
'muting' => null,
'muting_notifications' => null,
'requested' => null,
'domain_blocking' => null,
'showing_reblogs' => null,
'endorsed' => false
];
}
}