PHP code example of usamamuneerchaudhary / laraclient

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

    

usamamuneerchaudhary / laraclient example snippets


namespace App\Http\Controllers;

use Usamamuneerchaudhary\LaraClient\LaraClient;

class ApiController extends Controller
{
    $client = new LaraClient('weatherapi');
    $response = $client->get('current.json', ['q' => 'london']);
    $currentWeather = $response->getData();
    
    $client2 = new LaraClient('geodb');
    $georesponse = $client->get('countries');
    $countries = $response->getData();
    
    ....
    ....
    
}

 php artisan vendor:publish --provider="Usamamuneerchaudhary\LaraClient\LaraClientServiceProvider" --tag="config"