Skip to content

Kashif-Kframe/captcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Captcha

Captcha is a simple easy to use package for Laravel.

Getting Started

installing Captcha Composer Package Note: If you do not have Composer yet, you can install it by following the instructions on https://getcomposer.org

Step 1. Install package

composer require kashif/captcha

Step 2. Register the Captcha service provider

in config/app.php add following line

 Kashif\Captcha\CaptchaServiceProvider::class,

Publish Assets

To publish the assets run the below command.

 php artisan vendor:publish --tag=kashif

Using Captcha:

In Controller include and call captcha facade and send variable to view and print this variable in view as below

  use Kashif\Captcha\Captcha;
  $captcha = Captcha::render();
  return view('view',compact('captcha'));
  
  {!! $captcha !!}

If you want to use a helper function to create the captcha use below function.

  captcha();

Also a directive is available to render captcha in balde view, for this we just need to add below directive into the blade.

  @captcha

Verify Captcha:

To verify captcha text you need to call verify facade in controller and pass the text entered by user and it will return ture or false.

  Captcha::verify("captcha text");
  

A helper function is also available to verify the captcha

   captcha_verify("captcha text");

About

Simple captcha package for Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages