how to fix laravel 5.4 key too long error – mysql migration table

While migrating database in laravel 5.4, you may have seen following error on console.

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique

This is due to MySql configuration of key length allowed for a string. However this can be changed by updating MySql settings , we can have a quick fix like below.

In the boot method of  \app\Providers\AppServiceProvider.php file, set the default length of a database Schema string.

 Continue reading

Database Migrations and Seeding in Laravel

Database migration is facility to create, alter and drop a table in database using PHP script. This way everything could be tracked like a versioning. Further the database migration steps can also be rolled back using migration commands available with artisan in laravel. In laravel, artisan is a command available with every laravel installation. This command is useful to do many things through command line.

Have a look on  following commands
php artisan make:migration create_users_table
The above command will create a migration file named date_time_create_users_table in database/migrations directory. This file will contain a class CreateUsersTable with up() and down() method. In up() method, we should write create table, index etc and in down() we should write drop commands.  Continue reading

Installing Solr 6 on windows – 6 Simple steps

What is Solr

Solr is a open source  search platform built on Apache Lucene.

Note: Apache Lucene is a free and open-source information retrieval software library, originally written in Java by Doug Cutting.


This is a very popular search software that can be used with any programming languages like PHP, Java , dot net etc, with help of respective Solr Client extension.


Latest JVM (Java virtual Machine) must be already installed on your windows system.

 Continue reading

Card AutoFill for ICICI Bank Debit Card – During Tatkal booking on IRCTC

This is very useful to keep card information eg card no. and name on card filled before payment. On some website this is stored but on others (like IRCTC) there is no way to store it. If you book a ticket from IRCTC (specially Tatkal Tickect), You dont have time to fill the card to make payment. I have created a Magic Autofill for icici debit cart. You just need to fill the form and add  the created button ( named "Card AutoFill-ICICI") to your bookmark bar by Drag and drop.

During Tatkal booking on IRCTC, select Debit Card as payment method and then choose ICICI Bank and then click Make Payment.

This will redirect you icici bank's website for payment. Over there, you just have to click the bookmark named "Card AutoFill-ICICI". Now you get your form filled up except CVV, Card Pin and Captcha. You must immidiately fill the CVV, Card Pin and Captcha and click Pay.

This method of payment, does not require OTP so makes the payment faster than any other payment method.

 Continue reading