PHP code example of mobiadroit / laravel-weatherkit
1. Go to this page and download the library: Download mobiadroit/laravel-weatherkit library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mobiadroit / laravel-weatherkit example snippets
'providers' => [
Mobiadroit\LaravelWeatherKit\Providers\LaravelServiceProvider::class,
]
'aliases' => [
'WeatherKit' => Mobiadroit\LaravelWeatherKit\Facades\WeatherKit::class,
]
WeatherKit::location(lat, lon)->weather();
WeatherKit::lang('en_GB')->location(lat, lon)->weather();
WeatherKit::location(lat, lon)->dataSets(['currentWeather', 'forecastDaily'])->weather();
// OR
$weather = new \Mobiadroit\LaravelWeatherKit\WeatherKit();
$weather->location(lat, lon)->availability();
$weather->location(lat, lon)->weather();
WeatherKit::location(lat, lon)->currentAsOf(now())->weather();
WeatherKit::location(lat, lon)->dailyStart(now()->subDays(7))->dailyEnd(now())->weather();
WeatherKit::location(lat, lon)->hourlyStart(now()->subHours(24))->hourlyEnd(now())->weather();
WeatherKit::location(lat, lon)->timezone('Americas/Los_Angeles')->weather();
->currently()
->hourly()
->daily()
->nextHour()
WeatherKit::location(lat, lon)->hourly()
WeatherKit::location(lat, lon)->dataSets(['forecastHourly'])->weather()->get('forecastHourly')
bash
$ php artisan vendor:publish --provider=\Mobiadroit\LaravelWeatherKit\Providers\LaravelServiceProvider