-3
$ php artisan migrate
Migration table created successfully.
In Connection.php line 647:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users`
add unique `users_email_unique`(`email`))
In Connection.php line 449:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

what's the problem?:|

Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98
  • 4
    Possible duplicate of [Laravel migration: unique key is too long, even if specified](https://stackoverflow.com/questions/23786359/laravel-migration-unique-key-is-too-long-even-if-specified) – Mahdi Younesi Jan 29 '18 at 11:33
  • `what's the problem?:|` Really? – Matz Jan 29 '18 at 11:42

1 Answers1

1

Add this to AppServiceProvider.php

use Illuminate\Support\Facades\Schema;

public function boot()
{
    Schema::defaultStringLength(191);
}
Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98