onemineral/php-sdk

Onemineral PMS - PHP SDK

Installs: 3 873

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

Type:project

1.0.29 2025-04-01 11:19 UTC

README

Install

composer require onemineral/php-sdk

Initialize the sdk

use Onemineral\PMS\SDK\PMS;

PMS::setBaseURL('https://demo.rentalwise.io');
PMS::setToken('rentalwise-api-token');

Query properties

use Onemineral\PMS\SDK\PMS;
use Onemineral\PMS\SDK\Conditions;
use Onemineral\PMS\SDK\Paginator;

// Build conditions for property fields
$conditions = Conditions::factory()
    // query only enabled properties
    ->where('status', '=', 'enabled')
    // and where properties are in these location ids
    ->where('location', 'in', [1, 2, 3]);

/** @var Paginator $propertiesPaginator **/
$propertiesPaginator = PMS::property()->query()
    // apply conditions
    ->where($conditions);
    // paginate response
    ->paginate(1, 10)
    // include property location relation in response
    ->with(['location']);
    ->get();