tejas / tejascaptcha
Tejas Captcha for the Laravel framework
Installs: 140
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=7.0
- ext-gd: *
- intervention/image: >=2.2
- laravel/framework: >=7.9
Requires (Dev)
- mockery/mockery: >=0.9
- phpunit/phpunit: >=4.1
- dev-master
- 1.0.12.55
- 1.0.12.54
- 1.0.12.53
- 1.0.12.52
- 1.0.12.51
- 1.0.12.50
- 1.0.12.49
- 1.0.12.48
- 1.0.12.47
- 1.0.12.46
- 1.0.12.45
- 1.0.12.44
- 1.0.12.43
- 1.0.12.42
- 1.0.12.41
- 1.0.12.40
- 1.0.12.39
- 1.0.12.38
- 1.0.12.37
- 1.0.12.36
- 1.0.12.35
- 1.0.12.34
- 1.0.12.33
- 1.0.12.32
- 1.0.12.31
- 1.0.12.30
- 1.0.12.29
- 1.0.12.28
- 1.0.12.27
- 1.0.12.26
- 1.0.12.25
- 1.0.12.24
- 1.0.12.23
- 1.0.12.22
- 1.0.12.21
- 1.0.12.20
- 1.0.12.19
- 1.0.12.18
- 1.0.12.17
- 1.0.12.16
- 1.0.12.15
- 1.0.12.14
- 1.0.12.13
- 1.0.12.12
- 1.0.12.11
- 1.0.12.10
- 1.0.12.9
- 1.0.12.8
- 1.0.12.7
- 1.0.12.6
- 1.0.12.5
- 1.0.12.4
- 1.0.12.3
- 1.0.12.2
- 1.0.12.1
- 1.0.12.0
- 1.0.11.0
- 1.0.10.0
- 1.0.9.0
- 1.0.8.0
- 1.0.7.0
- 1.0.6.0
- 1.0.5.0
- 1.0.4.0
- 1.0.3.0
- 1.0.2.0
- 1.0.1.0
- 1.0.0.0
- 0.3.2.1
- 0.3.1.1
- 0.3.0.1
- 0.2.9.1
- 0.2.8.1
- 0.2.7.1
- 0.2.6.1
- 0.2.5.1
- 0.2.4.1
- 0.2.3.1
- 0.2.2.1
- 0.2.1.1
This package is auto-updated.
Last update: 2025-05-21 12:16:42 UTC
README
The tejas/tejascaptcha is a service provider for Laravel. The package randomly generates either an alpha numeric captcha or a math captcha and provides both refresh and audio capabilities.
Section links
Preview
Compatibility
The tejas/tejascaptcha service provider has been tested with Laravel versions 5, 6 and 7. Test were performed on a Linux / Debian / Apache2 web server.
Installation
Tejas Captcha
The TejasCaptcha Service Provider is installed via Composer.
From your projects root directory, open a terminal and run the command
composer require tejas/tejascaptcha
npm install bootstrap
npm install @fortawesome/fontawesome-free
Tejas Captcha Middleware - Captcha Verification
app/Http/Middleware/VerifyTejasCaptcha.php
Middleware is used to verify that the captcha was correctly entered.
From your projects root directory, open a terminal and run the command:
cp vendor/tejas/tejascaptcha/src/app/Http/Middleware/VerifyTejasCaptcha.php app/Http/Middleware/
.
This command copies the VerifyTejasCaptcha.php
middleware stub file to your projects app/Http/Middleware
folder.
namespace App\Http\Middleware;
use Tejas\TejasCaptcha\Http\Middleware\VerifyTejasCaptcha as Middleware;
class VerifyTejasCaptcha extends Middleware
{
/*
Uses the tejas/tejascaptcha service providers middleware
*/
}
app/Http/Kernel.php
In the app/Http/Kernel.php
file at the bottom of the routeMiddleware
section insert the following line:
'tejascaptcha_verify_captcha' => \App\Http\Middleware\VerifyTejasCaptcha::class,
Use this middleware declaration wherever the tejas/tejascaptcha is included in the Post submission.
example/routes/web.php
Example form submission route using tejascaptcha middleware
This route is declared in the example/routes/web.php
file. It is part of the working example files included with the Tejas Captcha package. See example/README.md for implementation details.
Route::post('tejascaptcha_verify_form','TejasCaptcha_Controller@tejasCaptcha')->middleware('tejascaptcha_verify_captcha');
Bootstrap - Laravel Installation
Open a terminal, navigate to your projects root directory and run:
composer require laravel/ui
php artisan ui bootstrap
- Alternatively if you also want the auth scaffoldings:
php artisan ui bootstrap --auth
- Alternatively if you also want the auth scaffoldings:
npm install && npm run dev
Tejas Captcha Makefile - Post Install
This step is optional.
To install the included Makefile run this from your projects root directory.
- cd vendor/tejas/tejascaptcha/scripts && bash postinstall.sh && cd ../../../../
The Makefile is installed inside the tejascaptcha directory in your projects root.
To run the tejascaptcha/Makefile after installing it; From your projects root directory run the following command with one of the specified make actions:
- make -C tejascaptcha [ install update test remove show_version ]
Register the Tejas Captcha service provider
This step is optional - tejas/tejascaptcha is registered automatically by Composer package discovery.
config/app.php
Register the tejas/tejascaptcha
service provider under the providers
key in config/app.php
.
'providers' => [ Tejas\TejasCaptcha\TejasCaptchaServiceProvider::class, ]
Register the tejas/tejascaptcha
service providers alias under the aliases
key in config/app.php
.
'aliases' => [ 'TejasCaptcha' => Tejas\TejasCaptcha\Facades\TejasCaptcha::class, ]
Configuration
Publish the configuration file
config/tejascaptcha.php
To customize tejas/tejascaptcha's settings run Laravels vendor:publish
artisan command from your projects root directory.
$ php artisan vendor:publish
Example output:
Type the number associated with tejascaptcha service provider and press enter. An editable copy of tejas/tejascaptcha's config file, tejascaptcha.php
, should have been copied to your projects config
directory.
Abbreviated default config file:
<?php
return [
'config_section_key' => 'standard',
'standard' => [
'length' => 5,
'width' => 230,
'height' => 50,
'quality' => 90,
'sensitive' => false,
],
'flat' => [], 'mini' => [], 'inverse' => [],
'audio' => [
'audioFilePrefix' => 'final'
]
];
There are 7 keys in the config file. The config_section_key
may point to one
of the four pre-built image representation sections, standard
is the default
config_section_key
value. You may override this value by setting it to
'flat', 'mini' or 'inverse'
. 🔺You may also override the
image selection by specifying 'flat', 'mini' or 'inverse'
as a post value
of tejascaptchaImageType
.
🔺refer to the tejas/tejascaptcha/example/js/tejascaptcha.js
file in the $('#tejas_captcha_refresh_icon')
click function.
The audio
key specifies the audio files name prefix.