yajra / zillow
Zillow API 的 Laravel 封装
v2.0.5
2017-10-04 23:49 UTC
Requires
- php: >=5.4.0
- fabpot/goutte: ~2.0
- guzzlehttp/guzzle: 4.*|5.*|6.*
Requires (Dev)
- phpunit/phpunit: 4.*
README
一个简单的 Zillow API 服务 Laravel 封装。
需求
依赖 PHP 5.4+,Goutte 2.0+,Guzzle 4+。
安装
在您的 composer.json
文件中将 yajra/zillow
添加为依赖项
Laravel 4
composer require yajra/zillow:~1.0
Laravel 5
composer require yajra/zillow:~2.0
配置
在您的 config/app.php
中,将 yajra\Zillow\ServiceProvider
添加到 providers 数组的末尾
'providers' => array( 'Illuminate\Auth\AuthServiceProvider', ... 'yajra\Zillow\ServiceProvider', ),
在 config/app.php
的末尾,将 Zillow
=> yajra\Zillow\Facade
添加到 aliases 数组
'aliases' => array( 'App' => 'Illuminate\Support\Facades\App', 'Artisan' => 'Illuminate\Support\Facades\Artisan', ... 'Zillow' => 'yajra\Zillow\Facade', ),
最后,发布配置文件
Laravel 4
$ php artisan config:publish yajra/zillow
Laravel 5
$ php artisan vendor:publish
然后通过更新以下文件中的 zws-id
值来设置您的 Zillow Web Services ID (ZWSID)
Laravel 4 app/config/packages/yajra/zillow/config.php
Laravel 5 config/zillow.php
###用法
使用特定的 API 调用方法进行请求
$params = [ 'address' => '5400 Tujunga Ave', 'citystatezip' => 'North Hollywood, CA 91601' ]; // Run GetSearchResults $response = Zillow::getSearchResults($params);
任何 Zillow API 调用都有效。有效的回调有:
- getZestimate
- getSearchResults
- getChart
- getComps
- getDeepComps
- getDeepSearchResults
- getUpdatedPropertyDetails
- getDemographics
- getRegionChildren
- getRegionChart
- getRateSummary
- getMonthlyPayments
- calculateMonthlyPaymentsAdvanced
- calculateAffordability
- calculateRefinance
- calculateAdjustableMortgage
- calculateMortgageTerms
- calculateDiscountPoints
- calculateBiWeeklyPayment
- calculateNoCostVsTraditional
- calculateTaxSavings
- calculateFixedVsAdjustableRate
- calculateInterstOnlyVsTraditional
- calculateHELOC
许可证
MIT 许可证。
链接
此包受到了 Zillow, PHP Wrapper 的启发。