Using laravel5.4, there is a field in json format, which is defined in the migration file like this:
$table->json('fruits')->nullable();
Error reporting when executing php artisan migrate
:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json null' at line 1
The
mysql version is too low,
json
type fields can only be used on the >=mysql5.7 version.