增加 用户生日
This commit is contained in:
parent
bdf5f1f0c1
commit
65835902b8
@ -112,17 +112,15 @@ public function callback(Request $request)
|
||||
$name = $oauth_user->name;
|
||||
$email = $oauth_user->email;
|
||||
$email_verified_at = $oauth_user->email_verified_at;
|
||||
$user = User::create([
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'password' => null,
|
||||
'email_verified_at' => $email_verified_at,
|
||||
'oauth_id' => $oauth_user->id,
|
||||
'provider' => 'LoliArt',
|
||||
'provider_id' => $oauth_user->id,
|
||||
'real_name' => $oauth_user->real_name,
|
||||
'balance' => 0
|
||||
]);
|
||||
|
||||
$user = new User();
|
||||
$user->name = $name;
|
||||
$user->email = $email;
|
||||
$user->password = null;
|
||||
$user->email_verified_at = $email_verified_at;
|
||||
$user->real_name = $oauth_user->real_name;
|
||||
$user->birthday_at = $oauth_user->birthday;
|
||||
$user->save();
|
||||
|
||||
$request->session()->put('auth.password_confirmed_at', time());
|
||||
} else {
|
||||
|
@ -122,6 +122,7 @@ class User extends Authenticatable
|
||||
'email_verified_at' => 'datetime',
|
||||
'balance' => 'decimal:2',
|
||||
'banned_at' => 'datetime',
|
||||
'birthday_at' => 'datetime',
|
||||
];
|
||||
|
||||
protected static function boot()
|
||||
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->date('birthday_at')->nullable()->after('email_verified_at');
|
||||
|
||||
// 真实姓名
|
||||
$table->string('real_name')->nullable()->after('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('birthday_at');
|
||||
$table->dropColumn('real_name');
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user