This package provides a PHP client for the Real Eztat API, which allows you to interact with real estate listings and related data.
You can install the package via Composer:
composer require wefabric/real-eztat
Add the following environment variable to your .env
file:
REAL_EZTAT_BASE_URL=https://realeztat.nl
REAL_EZTAT_API_KEY=your_api_key_here
REAL_EZTAT_CACHE_TTL=3600 // in seconds
To use the Real Eztat API client, you need to create an instance of the RealEztatService
class. Here's a basic example:
use Wefabric\RealEztat\Services\RealEztatService;
$realEztatService = new RealEztatService();
$objects = $realEztatService->get('api/objects/filter');
foreach ($objects['data'] as $object) {
echo $object['title'] . "\n";
}
There are also classes available for specific endpoints, such as NewConstructionProject
.
You can use these classes to interact with specific data types more easily. For example:
use Wefabric\RealEztat\Endpoints\NewConstructionProject;
$newConstructionProject = new NewConstructionProject();
$projects = $newConstructionProject->get();
foreach ($projects['data'] as $project) {
echo $project['title'] . "\n";
}
And for a specific project:
$project = $newConstructionProject->get('slug-of-the-project');
echo $project['title'] . "\n";
The package uses caching to improve performance. By default, it caches responses for 1 hour (3600 seconds). You can change the cache duration by setting the REAL_EZTAT_CACHE_TTL
environment variable in your .env
file.
To disable caching, set the REAL_EZTAT_CACHE_TTL
to 0
.