Giter VIP home page Giter VIP logo

captcha's Introduction

captcha

Simple Captcha for laravel 6

Installation

Require this package with composer:

composer require hamog/captcha

Find the providers key in config/app.php and register the Captcha Service Provider.

'providers' => [
    // ...
    Hamog\Captcha\CaptchaServiceProvider::class,
]

Find the aliases key in config/app.php.

'aliases' => [
    // ...
    'Captcha' => Hamog\Captcha\Facades\Captcha::class,
]

Configuration

To use your own settings, publish config.

php artisan vendor:publish --provider="Hamog\Captcha\CaptchaServiceProvider"

To use your own settings in config/captcha.php, publish config.

return [
    'width'         => 170,
    'height'        => 60,
    'font_color'    => '#1A3EA1', //only hexadecimal
    'size'          => 22,
    'length'        => 6,
    'sensitive'     => false,
];

Preview

captcha-preview

Usage

return captcha image:

{!! Captcha::create() !!}

//Or
{!! captcha() !!}

Create html image tag:

{!! Captcha::img() !!}

//Or
{!! captcha_img() !!}

return captcha src:

{!! Captcha::src() !!}

//Or
{!! captcha_src() !!}

Validation

Using captcha rule:

'captcha'   => 'required|captcha',

Add custom rule message:

'captcha' => 'The :attribute is invalid',

captcha's People

Contributors

hamog avatar khanzadimahdi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

captcha's Issues

it works incorectly

captcha() return "
�PNG

IHDR�<��y+�� vIDATx��{\�W����M��HD����T�V�T|����.Zm+�~�v��jۏ���Ֆ����nk���mY�S�R)VQ���("����g���� d�� 7C�� H��|?�q3s�e�oι�{�p���K�1��@3���[4��� -�EC�o���[4��� -�EC�o���[4��� -�EC�o���[4��� -�EC�o���[4,�zk4��ۏZdJ�k�Xhe/�E<�-w���f�1M����~�}��E&������&;��C=W�x<����c0�G=U=�3֞�V������3���֏��h����?���i�<ǩW�/mSI�T��^��Q���b-HH��q�!h�æU�F<
uL�?3��h0���-��c�j�D������4>^Bt�T�s�v~� g/WN��=��>L���29�6�9��G��h�$�����F��=Yc���(�;���|���v��1�j��;�zW�q����� �� �Q�j��j���ݗ�@J����4����)D���M��K,�o�����kգ���6����ϕ����r�'��֟S��߯ � ������j���``�w�Z�i�)���.�9������e
{��@��SQ�>u��a7��?�PF�E�+ ņ�SK+��^����7�ٞ,�ʟ9���������s������F������ϛa\�����N�d�5)���+�����n[
���{r�������4��s
����1�����h��yk�xR�
F��� ������L�$B��߼׌�
Bh�=�����������p������}99��i������ʕ�/��I�Z�!�<���o�o1�$�gu��=ҟ�eR�
F�iP�f���U����P�����D��".G;��������TN�r8�މ������bM�lg+��'�*���&y���� .��� (����j_�� gK������V���'��F9���U���k��ϸfć��X}%vuab�k���������5������[�n��uVqR�����?o��x�ІC\OH��u_'��7;���Q}SW��[�1bϖ�v�:_k��e�kT��"������$m*�v�e���T���CK�3�yؑ�lk>�@tpm�"5������S+�����WgJ��oX����L4j��׸CK�w&�����g�R����'�����氥��]W%�U�m��k�z���F�d����a/�����K\�������I���uǦ�����K�:����?�6֜�+���k����w�%D##W����,�!s�&��u6����^�Е|+d���� Z�O&���jc�-a>v�.�4��nI�vTaK��i��f�H�7��Q�{�l�֤��(�A�~���O���rUrf�����^"û���DN���]�}5
���WGk��ޟ^��a�����W% ���db�1���
����-�����A�/kW�����
��8M��5�2���2UtL���䁃���,�T�zP%W�k&;�Lv�1u��CI���S���q9��߬6L��=�MDO�^�����CMko��mc͙�'�-j���jy{g/a������WM����q��8��ޢ#���y�� =�a��4�m�?l�y�i�lGԙ���d�U�����εۏ�7uw��y50b��8�������n�B�����C��W�u@O���'��޽z����}�����M+��5�2<������Cn���Ǟ��}l�㍍��������������s�фP^-�j ��/�L�b��i����Kk���1Y����5*�c2��Q���)iS�=��CI�Y~�%������J�r���H��a�\��b����˪ڪ�; ��ˑ;SW�z���-r�G���r)�� b��ᆲD�S1t��^���+'k���@֮s]�C�n�:��k�J�${�o�ߊ�GN��?�K�D8������9^P��-�8��1�;?ʼ�Q�y���o�#�/�p,j�/��+�6lp�����+�|���o~(�V��$��K]; &�W<�N�kL��(�c2����M������#� Bh����;{�H�F��Ǟ-m�jmڊ��j��y �Į.N�|��Yp)��uf���8���?t���7���|p��R*�|,��w�S��M���V���+Y��;�_{����FҦ�O*���]/�6���A���Ĵj�/��7+оΚ���������L�� ����q�l�g��)9�īը��A�t������������P�3/%Q����>��Qp��=��#2������5��ҽ鞮���Y������J$y�2 �=�=��6R�]��L�ߧ��9�M8� �����a��;�(6�A�$��[�.��f���v���z����#�?�l��Ą��-��˽�3�r Z�����X�����_���dĂׅz�E���ޮ~�ixw����7��U�2�H���]m �g܌f�0�zc����%���Rߤ@��l?��n���-ڷ����&a��v2�(��_1�b�g�:gć��6޸��]���``�N6�gOZ�؃\���Q���_�W"!_�~i�P���=�����c� �G����u������6�N���y�����``!A�#8���噯�M#W���� ��L&fx�����r��J^�)��l�n�R��9�*iS����_E�s�G����G��Ǟ-���[��'*p�Ψ��b�����t�U��D� �=?�U�E<��g/��-I���� ��yŭ� ���/�Ѕ��c�q�|������C��z�^2�HL �&���0 ��^]����/���?�}d21� �x�<\l6��6s�=�X�����p�Y���T��ͺ%��Q�ɉ|���7�L8�o��.hf1�F�������se\��x���2t�D�~�e��G�g�'E�q\zn��ݩ���%�ᡞ��NnQ��SE�cﻣ���2���w~;��O]�B�6 ��$�Yy�u�]��RҦ"~�rU[G�����j�q2 }|��l�+����
�t��5��Q�H�S���?F����(���4zh4��]�"S��=��G�]���Y'�|�C)�h��0�n{��������������M����"+�}EP�5�������뎹��LK�Y_\!�ื�]�RO7'��}�Q�I��߇����4N]� bL+��@t�����:�W��Ez��9�lV�uM� ����'���V�w�RFmm��谷�-�*��b)��㢦�3x�y�̀a�*d���.���}������ e(�0���h�G��K�w��9�������wk��j� ��7����}�\���� |<����j���m����\z������������ڊ��(�����73��C��[4O�KJ3F��[4��� -�E�?�����K�IEND�B�"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.