Download the PHP package miladrahimi/laracaptcha without Composer

On this page you can find all versions of the php package miladrahimi/laracaptcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laracaptcha

LaraCaptcha

Laravel simple captcha

Documentation

LaraCaptcha is an easy-to-use captcha creator package for Laravel framework. It is built based on Laravel APIs and you can use it alongside Laravel facilities. LaraCaptcha using image based captcha to protect you from spams.

Installation

Run Terminal (Linux Based Environment) or Command Prompt (Windows OS) for your project's root where you can see `composer.json' file. Then run following command:

After adding the package to your project, you need to add LaraCaptcha provider to your project's providers. To do that, open config/app.php file and append following code to the list of providers.

Laravel <= 5.0

Laravel => 5.1

Captcha Image

You need to display a captcha image in your HTML forms, so LaraCaptcha provides a image url like what you see below that you can use easily.

You may use Laravel url() function in Blade template system to resolve this URL.

So your captcha image should be like this:

Random URL and caching problem

If you use methods mentioned above you will face to caching problem very soon. As it's needed every captcha must be a different thing when user reloads the page or press refresh button. But sometimes user browsers like Firefox and Chrome cache the image so users see the same image while server has created new image.

You may ask what should I do now? That's a good question! You have to add a fake parameter to the image url and pass a random value like following example:

To do it in Blade template system:

So your captcha image should be like this:

Refresh Button

If you don't need to refresh button for you captcha skip this section.

You are still here so you need it!

I consider you have created a button in your page Blade like this:

So you need to add following jQuery code to your page:

Validation

Now it's time to validate user input. I hope you use Laravel validation rules, so you can use laraCaptcha rule just like this:

Of course there is one step left. You should add a user-friendly error message if the user entered wrong captcha. To do this, open resources/lang/en/validation.php and add following item to the existent array.

Of course you are able to use :attribute in the validation message instead.

This approach enables you to use Laravel internationalization tools.

Homepage

Contributors

License

LaraCaptcha is released under the MIT License.


All versions of laracaptcha with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ~5.0
illuminate/support Version ~5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package miladrahimi/laracaptcha contains the following files

Loading the files please wait ....