Skip to content

Instantly share code, notes, and snippets.

@dhimasanb
Last active April 9, 2017 17:40
Show Gist options
  • Save dhimasanb/d052fd1e42cb35a3bd9931aeb2452d17 to your computer and use it in GitHub Desktop.
Save dhimasanb/d052fd1e42cb35a3bd9931aeb2452d17 to your computer and use it in GitHub Desktop.
Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes on Laravel 5.4
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; // Add this
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191); // and this
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment