DONE: phone number verification, admin can add user employment; WIP: wire with onewaysms

This commit is contained in:
ISMAIL MASSERAN
2026-07-12 12:36:46 +08:00
parent 431bbee17c
commit a11b75729a
37 changed files with 2214 additions and 73 deletions
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('phone_verification_otps', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('phone_number');
$table->string('code');
$table->timestamp('expires_at');
$table->unsignedTinyInteger('attempts')->default(0);
$table->timestamp('verified_at')->nullable();
$table->string('verification_token')->nullable();
$table->timestamp('verification_token_expires_at')->nullable();
$table->timestamps();
$table->index(['phone_number', 'expires_at']);
});
}
public function down(): void
{
Schema::dropIfExists('phone_verification_otps');
}
};
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
$table->timestamp('phone_verified_at')->nullable()->after('phone_number');
});
}
public function down(): void
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('phone_verified_at');
});
}
};