@@ -53,6 +53,7 @@ class OAuthController extends Controller
|
||||
"message" => "OAuth service failed to authenticate: " . $e->getMessage()
|
||||
]);
|
||||
}
|
||||
|
||||
$user = $this->findOrCreateUser($provider, $driverUser);
|
||||
|
||||
if (!$user) {
|
||||
@@ -116,6 +117,7 @@ class OAuthController extends Controller
|
||||
'name' => $socialiteUser->getName(),
|
||||
'email' => $email,
|
||||
'email_verified_at' => now(),
|
||||
'utm_data' => json_decode(request()->utm_data, true)
|
||||
]);
|
||||
|
||||
// Create and sync workspace
|
||||
|
||||
@@ -64,6 +64,7 @@ class RegisterController extends Controller
|
||||
'agree_terms' => ['required', Rule::in([true])],
|
||||
'appsumo_license' => ['nullable'],
|
||||
'invite_token' => ['nullable', 'string'],
|
||||
'utm_data' => ['nullable', 'array']
|
||||
], [
|
||||
'agree_terms' => 'Please agree with the terms and conditions.',
|
||||
]);
|
||||
@@ -82,6 +83,7 @@ class RegisterController extends Controller
|
||||
'email' => strtolower($data['email']),
|
||||
'password' => bcrypt($data['password']),
|
||||
'hear_about_us' => $data['hear_about_us'],
|
||||
'utm_data' => array_key_exists('utm_data', $data) ? $data['utm_data'] : null,
|
||||
]);
|
||||
|
||||
// Add relation with user
|
||||
|
||||
@@ -32,6 +32,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
'email',
|
||||
'password',
|
||||
'hear_about_us',
|
||||
'utm_data',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -54,6 +55,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
{
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'utm_data' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->json('utm_data')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('utm_data');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user