trackstone/laravel-immo-data 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trackstone/laravel-immo-data

最新稳定版本:v1.1.0

Composer 安装命令:

composer require trackstone/laravel-immo-data

包简介

Laravel integration for the Immo Data PHP SDK

README 文档

README

Tests

Laravel integration for the Immo Data PHP SDK — French real estate data including property valuation, geocoding, geographic boundaries, and market prices.

Requirements

  • PHP 8.3+
  • Laravel 11 or 12

Installation

composer require trackstone/laravel-immo-data

The service provider and facade are auto-discovered. No manual registration needed.

Configuration

Add your API key to .env:

IMMO_DATA_API_KEY=your-api-key

Optionally publish the config file:

php artisan vendor:publish --tag=immo-data-config

This creates config/immo-data.php:

return [
    'api_key'  => env('IMMO_DATA_API_KEY', ''),
    'base_url' => env('IMMO_DATA_BASE_URL', 'https://api.immo-data.fr'),
];

Usage

Via Facade

use ImmoData\Laravel\Facades\ImmoData;
use ImmoData\Enums\{RealtyType, GeoLevel, Condition, Dpe};
use ImmoData\Requests\ValuationRequest;

// Valuation
$request = new ValuationRequest(
    longitude: 2.3488,
    latitude: 48.8534,
    realtyType: RealtyType::Apartment,
    nbRooms: 3,
    livingArea: 65.0,
    condition: Condition::Excellent,
    dpe: Dpe::C,
    elevator: true,
);

$result = ImmoData::valuation()->estimate($request);
echo $result->mainValuation; // 485000.0

// Geocode
$results = ImmoData::geocode()->search('Paris', [GeoLevel::City]);
echo $results[0]->label; // "Paris, Ile-de-France"

// Geographic data
$city = ImmoData::geo()->city('75056');
echo $city->cityName; // "Paris"

// Market data
$price = ImmoData::market()->currentPrice(
    code: '75',
    geoLevel: GeoLevel::Department,
    realtyType: RealtyType::Apartment,
);
echo $price->value; // EUR/m²

Via Dependency Injection

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

Via Service Container

$client = app(ImmoData\ImmoDataClient::class);
$result = $client->geocode()->search('Lyon');

Available Methods

Resource Method Description
valuation() estimate(ValuationRequest) Property price estimation
geocode() search(string, ?GeoLevel[], int) Location search
geo() region(string) Get region by code
geo() department(string) Get department by code
geo() city(string) Get city by INSEE code
geo() district(string) Get district by code
geo() subdistrict(string) Get subdistrict (IRIS) by code
market() priceHistory(string, GeoLevel, RealtyType, ?string, ?string) Price history
market() currentPrice(string, GeoLevel, RealtyType) Current price per m²

For full documentation on request parameters, DTOs, enums, and error handling, see the PHP SDK documentation.

Code Style

This package uses Laravel Pint with the PER Coding Style preset.

# Fix code style
composer cs

# Check without fixing
composer cs:check

Testing

composer test

License

MIT

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固