Laravel / PHP
Build a vacation rental backend with Laravel + Repull PHP SDK.
1
Prerequisites
PHP 8.1+ and Composer installed on your machine.
You also need a Repull API key. Get one from your dashboard.
2
Install
composer require repull/sdk
3
Set up environment variables
Add your credentials to a .env file in your project root:
REPULL_API_KEY=sk_test_YOUR_KEY REPULL_WORKSPACE_ID=YOUR_WORKSPACE_ID
Start with sk_test_ keys for sandbox data. Switch to sk_live_ when you are ready for production.
4
Make your first API call
Set up the SDK with your API key, then call any endpoint. The example below lists properties and fetches reservations.
<?php
// app/Services/RepullService.php
namespace App\Services;
use Repull\Client;
class RepullService
{
private Client $client;
public function __construct()
{
$this->client = new Client(
env('REPULL_API_KEY'),
env('REPULL_WORKSPACE_ID')
);
}
/** How do I list properties in Laravel? */
public function getProperties(): array
{
return $this->client->properties()->list();
}
/** How do I get Airbnb reservations in Laravel? */
public function getAirbnbReservations(): array
{
return $this->client->reservations()->list([
'source' => 'AIRBNB',
'status' => 'CONFIRMED',
]);
}
/** How do I update pricing in Laravel? */
public function updateAvailability(string $propertyId, array $updates): array
{
return $this->client->availability()->update([
'propertyId' => $propertyId,
'updates' => $updates,
]);
}
}
// routes/api.php
Route::get('/properties', function (RepullService $dom) {
return response()->json($dom->getProperties());
});
Route::get('/reservations/airbnb', function (RepullService $dom) {
return response()->json($dom->getAirbnbReservations());
});5
Next steps
You are all set. Explore the rest of the platform:
AI