The right fix for this problem is to add a server version on config/database.php under the MySQL section.
'server_version' => "5.7"
because if you don't, Doctrine will use Doctrine\DBAL\Platforms\MySqlPlatform which supports all versions of MySQL since MySQL 5.0 which does not support JSON fields, and by adding the server_version Doctrine will load MySQL57Platform that have support for JSON instead of MySqlPlatform.
example of database MySQL config for Laravel 7:
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'server_version' => "5.7",
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],