1. Go to this page and download the library: Download revolution/laravel-bluesky library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
revolution / laravel-bluesky example snippets
// routes/web.php (CURRENTLY NOT WORKING - unauthenticated usage is temporarily restricted)
use Illuminate\Support\Facades\Route;
use Revolution\Bluesky\Facades\Bluesky;
Route::get('search', function () {
/** @var \Illuminate\Http\Client\Response $response */
$response = Bluesky::searchPosts(q: '#bluesky', limit: 10);
$response->collect('posts')
->each(function (array $post) {
dump(data_get($post, 'author.displayName'));
dump(data_get($post, 'author.handle'));
dump(data_get($post, 'author.did'));
dump(data_get($post, 'record.text'));
});
});