PHP code example of trackstone / laravel-immo-data
1. Go to this page and download the library: Download trackstone/laravel-immo-data 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/ */
use ImmoData\ImmoDataClient;
use ImmoData\Enums\RealtyType;
use ImmoData\Requests\ValuationRequest;
class PropertyController extends Controller
{
public function __construct(
private readonly ImmoDataClient $immoData,
) {}
public function estimate()
{
$request = new ValuationRequest(
longitude: 2.3488,
latitude: 48.8534,
realtyType: RealtyType::Apartment,
nbRooms: 3,
livingArea: 65.0,
);
return $this->immoData->valuation()->estimate($request);
}
}