未分類

How to solve SQLSTATE 42000 error in Laravel

To solve this error, locate app/Providers/AppServiceProvider.php and add Schema::defaultStringLength(191);

in boot method as following.

use Illuminate\Support\Facades\Schema;

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