PHP code example of gocustodia / laravel-weatherkit

1. Go to this page and download the library: Download gocustodia/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/ */

    

gocustodia / laravel-weatherkit example snippets


'providers' => [
    CustodiaFork\LaravelWeatherKit\Providers\LaravelServiceProvider::class,
]

'aliases' => [
    'WeatherKit' => CustodiaFork\LaravelWeatherKit\Facades\WeatherKit::class,
]

WeatherKit::location(lat, lon)->dataSets(['currentWeather', 'forecastDaily'])->weather();

// OR

$weather = new \CustodiaFork\LaravelWeatherKit\WeatherKit();
$weather->location(lat, lon)->availability();
$weather->location(lat, lon)->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=\CustodiaFork\LaravelWeatherKit\Providers\LaravelServiceProvider
 php
WeatherKit::location(lat, lon)->weather();
 php
WeatherKit::lang('en_GB')->location(lat, lon)->weather();
 php
WeatherKit::location(lat, lon)->currentAsOf(now())->weather();
 php
WeatherKit::location(lat, lon)->dailyStart(now()->subDays(7))->dailyEnd(now())->weather();
 php
WeatherKit::location(lat, lon)->hourlyStart(now()->subHours(24))->hourlyEnd(now())->weather();
 php
WeatherKit::location(lat, lon)->timezone('Americas/Los_Angeles')->weather();