Download the PHP package zhan3333/sturents-api without Composer
On this page you can find all versions of the php package zhan3333/sturents-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package sturents-api
StuRents API Helper
Install using composer:
php composer.phar require sturents/api
Wait, what's Composer?
Composer is the de-facto package manager for PHP projects. If you haven't used it before it is very simple to set up.
- Visit the Composer download page and follow instructions to download composer into your project root.
- You should now have a file called
composer.phar
in your project root. You can run various commands using this file. - Start by running
php composer.phar init
to create yourcomposer.json
file. This file stores all your project configuration and dependencies. - Now either run the command at the top of the readme to install the StuRents API, or add
"sturents/api": "*"
to the"require"
object inside yourcomposer.json
file.
To use Composer dependencies inside a PHP file is simple - just the following to the top of your file:
require_once __DIR__.'/vendor/autoload.php';
Now you can create or use any object without having to worry about requiring its files - Composer and PHP's autoloader will handle that for you.
Send a property to StuRents
$data = [
... // see https://sturents.com/software/developer/house-create
];
$create_house = new \Sturents\Api\CreateOrUpdateHouse(LANDLORD_ID, API_KEY);
$create_house->setJson($data);
try {
$create_house->send();
}
catch (\Exception $e){
echo "A problem happened: ".$e->getMessage();
}
var_dump($create_house->responseJson()->isSuccess()); // true if request succeeded
$affected_id = $create_house->responseAffectedProperty(); // outputs an integer
Fetch data from StuRents
$fetch_houses = new \Sturents\Api\FetchHouses(LANDLORD_ID, PUBLIC_KEY);
try {
$fetch_houses->fetchAll();
$properties = $fetch_houses->getProperties();
}
catch (\Exception $e){
echo "A problem happened: ".$e->getMessage();
}
echo count($properties) // echo, e.g. 1
All versions of sturents-api with dependencies
PHP Build Version
Package Version
The package zhan3333/sturents-api contains the following files
Loading the files please wait ....