PHP code example of matthewhallcom / pirate-weather-php

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

    

matthewhallcom / pirate-weather-php example snippets


    use MatthewHallCom\PirateWeather\PirateWeather;

    $forecast = (new PirateWeather('secret-key'))
        ->location(46.482, 30.723)
        ->forecast('daily');

    echo $forecast->daily()->summary();
    

$timeMachine = (new PirateWeather('secret-key'))
    ->location(46.482, 30.723)
    ->timeMachine('2020-01-01', 'daily');

echo $timeMachine->daily()->summary();

$timeMachine = (new PirateWeather('secret-key'))
    ->location(46.482, 30.723)
    ->timeMachine(['2020-01-01', '2020-01-02', '2020-01-03'], 'daily');

echo $timeMachine['2020-01-02']->daily()->summary();

    use PirateWeather;

    $forecast = PirateWeather::location(46.482, 30.723)
        ->forecast('daily');

    echo $forecast->daily()->summary();
    
shell script
    composer 
shell script
    php artisan vendor:publish --provider="MatthewHallCom\PirateWeather\Adapters\Laravel\PirateWeatherServiceProvider"