SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long
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
}use Illuminate\Support\Facades\Schema;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
Also in PHP:
- convert letters to uppercase php
- 4random numbers php
- Day of Week Using carbon library
- create symfony project
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:
- changer le format d'une date php
- cache set in laravel
- add 5 days to current date in php
- equivalent console.log in php
- date to timestamp in php
- creating new project laravel
- base64_decode image string php
- ci db query error
- catch http exceptions php
- $heure = date('H'); php 5
- date format functino php
- convert image to base64 php
- codeigniter where order by
- add another field in existing migration laravel
- Call to a function trim() on string laravel
- Laravel 7 do not see my new added seeder
- display errors in production
- convert a string into uppercase php
- check if contains substring php