简体   繁体   中英

Laravel database, what data type should I use to store email?

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

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

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

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

            $table->timestamps();
        });

You have to use string as follows:

$table->string('email');

You should use string type like this:

$table->string('email');

You can use the below codes, both are correct:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM