request( 'POST', 'https://brid.gy/micropub', [ 'headers' => [ 'Authorization' => 'Bearer ' . config('bridgy.mastodon_token'), ], 'json' => [ 'type' => ['h-entry'], 'properties' => [ 'content' => [$this->note->getRawOriginal('note')], ], ], ] ); // Parse for syndication URL if ($response->getStatusCode() === 201) { $mastodonUrl = $response->getHeader('Location')[0]; $this->note->mastodon_url = $mastodonUrl; $this->note->save(); } } }