2018-11-19 04:53:05 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Transformer\Api;
|
|
|
|
|
2019-01-28 02:40:36 +00:00
|
|
|
use Auth;
|
2018-11-19 04:53:05 +00:00
|
|
|
use App\Profile;
|
|
|
|
use League\Fractal;
|
|
|
|
|
|
|
|
class RelationshipTransformer extends Fractal\TransformerAbstract
|
|
|
|
{
|
|
|
|
public function transform(Profile $profile)
|
|
|
|
{
|
2019-01-28 02:40:36 +00:00
|
|
|
$user = Auth::user()->profile;
|
2018-11-19 04:53:05 +00:00
|
|
|
return [
|
2019-01-28 02:40:36 +00:00
|
|
|
'id' => (string) $profile->id,
|
|
|
|
'following' => $user->follows($profile),
|
|
|
|
'followed_by' => $user->followedBy($profile),
|
2018-11-19 04:53:05 +00:00
|
|
|
'blocking' => null,
|
|
|
|
'muting' => null,
|
|
|
|
'muting_notifications' => null,
|
|
|
|
'requested' => null,
|
|
|
|
'domain_blocking' => null,
|
|
|
|
'showing_reblogs' => null,
|
2019-01-28 02:40:36 +00:00
|
|
|
'endorsed' => false
|
2018-11-19 04:53:05 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|