Limit verification, one sentence call geetest, reduce development time

Source: Internet
Author: User

1. Description

Officially given the SDK call method too wasted development time, I wrote a call very simple a geetest package as far as possible to reduce the development time, if you think the official given the SDK is good enough, can not be used.

2. Installation

  1. Composer require laraveler/geetest
  2. Add Geetest\provider\geetestserviceprovider::class to the providers array in config/app.php
  3. Execute PHP Artisan vendor:publish

3. Call

  1. Use Geetest\facades\geetest
  2. Return Geetest::init ($request, function () {auth::attempt ([...])},function () {...});

The $request object needs to be injected during initialization, the second parameter is the action to be done after validation succeeds, and the third parameter is the action required to validate the failure

Note: The method that calls Geetest must be registered as any in routes

Config in laravel config directory (geetest.php)

"Api_url" = "http://api.geetest.com/register.php?gt={id}&user_id={user_id}"

The {ID} here is parsed to automatically get the ID option in config, as well as user_id.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.