# Troubleshooting


# Dates localization

Since Laravel 5.8, this package use Carbon 2 (opens new window) instead of Jenssegers/Date (opens new window) to translate dates.

Date format now use the format of momentjs. To translate your dates, you must now use the Carbon 2 class method isoFormat instead of format

See Carbon 2 documentation (opens new window)


# Migration error

MySQL < v5.7.7 or MariaDB

When you run php artisan migrate and you hit this error :

[PDOException]
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

This is an error from a change since Laravel 5.4 : see here (opens new window)

To correct this, two possibilities :

  • Define utf8 instead of utf8mb4 as default database charset and utf8_unicode_ci instead of utf8mb4_unicode_ci as default database collation.

  • Edit your app/Providers/AppServiceProvider.php file and define a default string inside the boot method :

use Illuminate\Support\Facades\Schema;

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