I just started to learn Laravel 5.4 and trying to migrate a users table in Laravel. When I run my migration I get this error:
[Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
After following this tutorial, I now have another error:
PHP Fatal error: Class 'App\Providers\ServiceProvider' not found
My migration code is
use Illuminate\Support\Facades\Schema;
public function boot()
{
//
Schema::defaultStringLength(191);
}
What am I doing wrong?
AppServiceProvider
class? Either way, can you please post the entire code for the file and identify it, that may help us help you resolve the issue. – stratedgeAppServiceProvider
class still have theuse Illuminate\Support\ServiceProvider;
statement in it? – stratedge