travoltron / zillow
为Zillow API提供的Laravel包装器
2.0.7
2016-08-01 16:04 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: 5.*
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' => array( 'Illuminate\Auth\AuthServiceProvider', ... 'yajra\Zillow\ServiceProvider', ),
在config/app.php
文件的末尾,将Zillow
=> yajra\Zillow\Facade
添加到别名数组中
'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的启发