tarekrahala/giata-hotels-api 问题修复 & 功能扩展

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

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

tarekrahala/giata-hotels-api

Composer 安装命令:

composer require tarekrahala/giata-hotels-api

包简介

this is a giata hotels api

README 文档

README

Software License Travis Total Downloads

Install

composer require amirhamdy/giata-hotels-api

For versions < 5.5 of Laravel, add the service provider of the package and alias the package.

Open your config/app.php file.

Add a new line to the providers array:

GiataHotels\GiataHotelsServiceProvider::class

And add a new line to the aliases array:

'GiataAPI' => GiataHotels\GiataHotelsFacade::class

Now you're ready to start using the GiataAPI in your application.

Quick start

use GiataAPI;

$response = GiataAPI::getHotelsByCountry('EG', true);
// $response sample:

{
  "property": [{
      "giataId": "3",
      "lastUpdate": "2020-04-26T03:18:15+02:00",
      "href": "https://multicodes.giatamedia.com/webservice/rest/1.latest/properties/3"
    },
    {
      "giataId": "4",
      "lastUpdate": "2020-04-26T03:18:15+02:00",
      "href": "https://multicodes.giatamedia.com/webservice/rest/1.latest/properties/4"
    },
    ...
    ...
  ],
  "country": "EG",
  "lastUpdate": "2020-04-30"
}

Usage

This package gives you the following methods to use:

GiataAPI::getHotelsByCountry()

Getting all hotels in a country, you can just use the getHotelsByCountry() method.

  • In its most basic form you can specify the countryCode.
GiataAPI::getHotelsByCountry('EG');
  • As an optional second parameter you can pass it, the multi boolean option so you can get all information for each hotel in one request.
GiataAPI::getHotelsByCountry('EG', true);

GiataAPI::getHotelByGiataId()

  • Getting hotel's information using its Giata ID.
GiataAPI::getHotelByGiataId(3);

GiataAPI::getImagesByGiataId()

  • Getting hotel's images using its Giata ID.
GiataAPI::getImagesByGiataId(3);

GiataAPI::getTextsByGiataId()

  • Getting hotel's translations in a specific language default='ar using its Giata ID.
GiataAPI::getTextsByGiataId(3);
  • As a second parameter you can pass the language.
GiataAPI::getTextsByGiataId(3, 'fr');

Other packages you may be interested in

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email amirhamdy4@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-03