gnahotelsolutions/laravel-weather 问题修复 & 功能扩展

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

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

gnahotelsolutions/laravel-weather

Composer 安装命令:

composer require gnahotelsolutions/laravel-weather

包简介

🌤️ A wrapper around Open Weather Map to get the current weather on a location.

README 文档

README

Latest Version on Packagist Build status Quality Score Total Downloads

🌤️ A wrapper around Open Weather Map API (Current weather)

Installation

You can install the package via composer:

composer require gnahotelsolutions/laravel-weather

Usage

Fill the WEATHER_API_KEY environment variable with your own API key to query the server.

use GNAHotelSolutions\Weather\Weather;

$weather = new Weather();

// Checking weather by city name
$currentWeatherInGirona = json_decode($weather->get('girona,es'));

// You can use the city id, this will get you unambiguous results
$currentWeatherInGirona = json_decode($weather->find('3121456'));

Units

By default the package uses metric for Celsius temperature results, this can be modified using the configuration file or on the fly:

$weather = new Weather();

$currentWeatherInGirona = json_decode($weather->inUnits('imperial')->get('girona,es'));

Language

By default the package uses es for the description translation, this can be modified using the configuration file or on the fly:

$weather = new Weather();

$currentWeatherInGirona = json_decode($weather->inLanguage('en')->get('girona'));

Guzzle Client Instance

If you need to use another instance of Guzzle, to modify headers for example:

$weather = new Weather();

$guzzle = $this->getSpecialGuzzleClient();

$currentWeatherInGirona = json_decode($weather->using($guzzle)->get('girona'));

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email dllop@gnahs.com instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 38
  • Watchers: 4
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固