skapelapp/ipstack-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

skapelapp/ipstack-laravel

最新稳定版本:v1.0.3

Composer 安装命令:

composer require skapelapp/ipstack-laravel

包简介

Get information from a visitor's IP address using IPStack and use it in your Laravel project.

README 文档

README

Packagist Packagist Downloads GitHub

The "skapelapp/ipstack-laravel" package allows you to retrieve visitor information based on their IP address using the IPStack service in your Laravel projects.

Requirements

Installation

You can add the package to your Laravel project using Composer:

composer require skapelapp/ipstack-laravel

Configuration

1. Set your IPStack API Key in your .env file:

IPSTACK_API_KEY=your-ipstack-api-key

2. Run the following command to publish the configuration:

php artisan vendor:publish --tag=ipstack-laravel-config

This command will create the config/ipstack.php file. You can check and modify your API key in this file.

3. Service Provider and Alias Configuration:

Add the service provider and aliases in your config/app.php file:

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

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

Usage

You can use the IPStack class to interact with the package:

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);

Testing

To run the package tests:

composer test

Updates

To update the package, use the following command:

composer update skapelapp/ipstack-laravel

License

This package is licensed under the MIT License. For detailed information, see the LICENSE file.

统计信息

  • 总下载量: 228
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-08