Geetest web page operation
One, register
Second, the login
1. Set your project’s website
2, Click on the overview, copy the ID and KEY, and add the project
Document center
Geetest extension package installation
1, command or require in composer. Json
The command
$ php artisan vendor:publish --tag=geetestCopy the code
composer.json
"germey/geetest": "3.0"Copy the code
The command
$ composer updateCopy the code
Laravel framework
Framework version > 5.1
1, configuration,
Open the config/app. PHP
Will add
Germey\Geetest\GeetestServiceProvider::classCopy the code
Aliases to add
'Geetest' => Germey\Geetest\Geetest::classCopy the code
2. Generate a configuration file
The command
$ php artisan vendor:publish --tag=geetestCopy the code
After the command is executed, geetest. PHP is created in the config folder, and you can configure prompts.
3. Add the ID and KEY to the. Env file
GEETEST_ID= your ID GEETEST_KEY= your KEYCopy the code
4. Description of template file
In resources/views/vendor/geetest/geetest blade. The PHP file
You can change alert, for example, I like sweetalert, I will change alert to swal
5. If any error is reported, please refer to 6.
In any view, just need to call to generate a qr code, look and turn the page is not like ^_^
{!!!!! Geetest::render() !! }Copy the code
Create a controller and introduce a template that can be tested by adding the following code
<form action="/" method="post">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="text" name="name" placeholder="name"> {!!!!! Geetest::render() !! } <inputtype="submit" value="submit">
</form>Copy the code
The effect
Report error processing, see if your mistake is the same as mine
Solution: open the vendor/germey/geetest/SRC/GeetestController. PHP
On line 14, change app() to Application and see if GeetestController has the following code.
use Illuminate\Foundation\Application;Copy the code
To the previous end of the page verification is realized, if the document is wrong, please contact me or leave a message;