欢迎。我已经学习了几天 Laravela 并在注册时停了下来。我有迁移:
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name', 120);
$table->string('surname', 120);
$table->string('email', 120)->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->bigInteger('counter')->default(0);
$table->string('url_address', 160);
$table->string('ip', 25);
$table->dateTime('date_of_registration');
$table->bigInteger('company_id')->unsigned();
$table->boolean('isCompany')->default(0);
$table->boolean('isMailing')->default(0);
$table->text('note');
$table->string('nip1', 12);
$table->string('business1', 120);
$table->string('phone1', 60);
$table->string('street1', 150);
$table->string('number1', 8);
$table->string('postal_code1', 12);
$table->string('city1', 100);
$table->bigInteger('country_id1')->default(0);
$table->bigInteger('provincial_id1')->default(0);
$table->string('nip2', 12);
$table->string('business2', 120);
$table->string('phone2', 60);
$table->string('street2', 150);
$table->string('number2', 8);
$table->string('postal_code2', 12);
$table->string('city2', 100);
$table->bigInteger('country_id2')->default(0);
$table->bigInteger('provincial_id2')->default(0);
$table->string('nip3', 12);
$table->string('business3', 120);
和功能:
function generateSeoUrl(string $string): string
{
$string = preg_replace("/ +/", "-", trim($string));
$string = mb_strtolower(preg_replace('/[^A-Za-z0-9-]+/', '', $string), 'UTF-8');
return $string;
}
上表使用的是 Laravel 的默认授权(我使用的是 Laravel 5.8)。
如何在注册时添加:
- ip - IP address of the user who registered
- date_of_registration - current date
- url_address - here I would like to save the generatedSeoUrl result ($ email)
请帮忙。我已经坐在这里好几个小时了,我不知道如何处理它:(
慕妹3242003
三国纷争