Tuesday, 25 April 2017

Laravel 5.4 when migrating getting too long error

I can fix this by going in the migration for the user's table, and manually specifying the max-length of the email field, like so:

$table->string('email', 250)->unique();

As outlined in the Migrations guide to fix this all you have to do is edit your AppServiceProvider.php file and inside the boot method set a default string length:

use Illuminate\Support\Facades\Schema;
public function boot()
{
    Schema::defaultStringLength(191);

No comments:

Post a Comment

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in Laravel

  WampServer: Download this file:  http://curl.haxx.se/ca/cacert.pem Place this file in the  C:\wamp64\bin\php\php7.1.9  folder Open  php.in...

Popular Articles