PHP code example of skapelapp / ipstack-laravel

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

    

skapelapp / ipstack-laravel example snippets


'providers' => [
    // ...
    Skapelapp\IpstackLaravel\IpstackLaravelServiceProvider::class,
],

'aliases' => [
    // ...
    'IPStack' => Skapelapp\IpstackLaravel\Facades\IPStack::class,
],

use Skapelapp\IPStackLaravel\IPStack;

// Create an instance of the IPStack class and provide your API key
$apiKey = config('ipstack.api_key');
$ipstack = new IPStack($apiKey);

// Use the getInfo method to retrieve information
$ipInfo = $ipstack->getInfo();

// Make use of the returned information
// dd($ipInfo);
bash
php artisan vendor:publish --tag=ipstack-laravel-config