Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes laravel string length 1000

PHP
use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}

Source

Also in PHP: