usevalid-email/laravel-sdk
最新稳定版本:1.0
Composer 安装命令:
composer require usevalid-email/laravel-sdk
包简介
Validate Your Emails with Confidence
README 文档
README
Validate Your Emails with Confidence
Installation
You can install the package via composer:
composer require usevalid-email/laravel-sdk
Usage
Initialization
use UseValidEmail\LaravelSdk\LaravelSdk; $token = 'your-access-token'; $sdk = new LaravelSdk($token);
Validate Email
use Illuminate\Support\Facades\Validator; $validator = Validator::make(['email' => 'test@example.com'], [ 'email' => 'valid_email', ]); if ($validator->fails()) { echo "Invalid email."; } else { echo "Valid email."; }
Controller Example
Here is an example of how to use the valid_email validator in a Laravel controller:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class EmailValidationController extends Controller { public function validateEmail(Request $request): \Illuminate\Http\RedirectResponse { $request->validate([ 'email' => 'required|email|valid_email', ]); return back()->with('success', 'Valid email.'); } }
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-01