SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 byt
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
//add/edit the following into app/Providers/AppServiceProviders.php:
use Illuminate\Support\Facades\Schema;
function boot()
{
Builder::defaultStringLength(191); // Update defaultStringLength
}
Also in PHP:
- contains in string php
- WordPress add query string to URL
- create alphanumeric code php
- How to execute “php artisan migrate” and other Laravel commands in remote server?
- check variable data type with value in php
- cakephp extract array
- Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)
- datetime php now
- Could not open input file: composer.phar
- In php how to check the contains in the string
- date as php
- check if key exist in php
- carbon now
- end session variable php
- datetimepicker format php
- check if home page woocmerce
- csv to json php
- codeigniter load form_validation
- errors throwing in php
- assign multiple variables php
- check if array key matches php
- SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 byte
- Allowed memory size of 134217728 bytes exhausted (tried to allocate
- array key value php