Answers for "syntax error or access violation: 1071 specified key was too long; max key length is 767 bytes lumen"

PHP
19

ERROR 1071 (42000) at line 76: Specified key was too long; max key length is 767 bytes laravel

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}
Posted by: Guest on April-29-2020
2

Syntax error or access violation: 1071 Specified key was too long;

// Para resolver isso siga os passos abaixo:

// Edite o arquivo app\Providers\AppServiceProvider.php
// Adicione o namespace use Illuminate\Support\Facades\Schema;
// Dentro do método boot adicione Schema::defaultStringLength(191);
// Resultado final do arquivo:

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}
Posted by: Guest on February-19-2022

Code answers related to "syntax error or access violation: 1071 specified key was too long; max key length is 767 bytes lumen"

Browse Popular Code Answers by Language