followRequest = $followRequest; } /** * Execute the job. * * @return void */ public function handle() { $follow = $this->followRequest; $actor = $follow->actor; $target = $follow->target; if($actor->domain == null || $actor->inbox_url == null || !$target->private_key) { return; } $fractal = new Fractal\Manager(); $fractal->setSerializer(new ArraySerializer()); $resource = new Fractal\Resource\Item($follow, new RejectFollow()); $activity = $fractal->createData($resource)->toArray(); $url = $actor->sharedInbox ?? $actor->inbox_url; Helpers::sendSignedObject($target, $url, $activity); $follow->delete(); return; } }