Home > front end >  Laravel database, what data type should I use to store email?
Laravel database, what data type should I use to store email?

Time:01-03

Schema::create('signups', function (Blueprint $table) {
            $table->id();

            $table->string('first name');

            $table->string('last name');

            $table->??('email');

            $table->timestamps();
        });

CodePudding user response:

You have to use string as follows:

$table->string('email');

CodePudding user response:

You should use string type like this:

$table->string('email');

CodePudding user response:

You can use the below codes, both are correct:

$table->string('email')
$table->varchar('email')
  • Related