stopreg/laravel 问题修复 & 功能扩展

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

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

stopreg/laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require stopreg/laravel

包简介

The official Laravel SDK for StopReg.

README 文档

README

Latest Version on Packagist License: MIT

The official Laravel SDK for StopReg, providing seamless email and domain verification to protect your Laravel applications from fraudulent registrations.

Features

  • Facade Support: Simple StopReg::checkEmail() syntax.
  • Auto-Discovery: Automatic service provider and facade registration.
  • Configurable: Easily publish and manage your API tokens.
  • Validation-Ready: Perfect for use within Laravel request validation.

Installation

Install the package via composer:

composer require stopreg/laravel

Configuration

Publish the configuration file:

php artisan vendor:publish --tag="stopreg-config"

Then, add your StopReg API token to your .env file:

STOPREG_API_TOKEN=your_api_token_here

Usage

Using the Facade

You can use the StopReg facade to verify emails and domains anywhere in your application.

use StopReg;

// 1. Verify an email address
$result = StopReg::checkEmail('user@disposable.com');

if ($result['data']['classification']['is_disposable']) {
    return back()->withErrors(['email' => 'Please use a permanent email address.']);
}

// 2. Verify a domain
$domainResult = StopReg::checkDomain('gmail.com');
echo $domainResult['data']['domain']['provider']; // "google"

In a Controller

public function register(Request $request)
{
    $verification = StopReg::checkEmail($request->email);
    
    if ($verification['data']['classification']['is_disposable']) {
        // Block registration
    }
}

Domain Verification

$result = StopReg::checkDomain('example.com');

$provider = $result['data']['domain']['provider'];
$mxFound = $result['data']['mail_server']['mx_found'];

Error Handling

The SDK throws an InvalidArgumentException for invalid inputs and StopRegException for API-level errors.

try {
    StopReg::checkEmail('not-an-email');
} catch (\InvalidArgumentException $e) {
    echo $e->getMessage();
}

License

MIT © StopReg

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固