Docs/Documentation/Quickstart

Laravel / PHP

Build a vacation rental backend with Laravel + Repull PHP SDK.

Installation

composer require repull/sdk

Complete Example

<?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());
});

Environment Variables

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 ready for production.

AI