diff --git a/resources/views/livewire/pages/auth/register.blade.php b/resources/views/livewire/pages/auth/register.blade.php index 0a87cd9..223841b 100644 --- a/resources/views/livewire/pages/auth/register.blade.php +++ b/resources/views/livewire/pages/auth/register.blade.php @@ -23,6 +23,7 @@ new #[Layout('layouts.guest')] class extends Component $validated = $this->validate([ 'name' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class], + 'phone' => ['required', 'regex:/^09\d{8}$/', 'unique:'.User::class], // 新增 phone 欄位驗證 'password' => ['required', 'string', 'confirmed', Rules\Password::defaults()], ]); @@ -54,6 +55,13 @@ new #[Layout('layouts.guest')] class extends Component + +
+ + + +
+
diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index 16100aa..e21351f 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -24,6 +24,7 @@ class RegistrationTest extends TestCase $component = Volt::test('pages.auth.register') ->set('name', 'Test User') ->set('email', 'test@example.com') + ->set('phone', '0912345678') ->set('password', 'password') ->set('password_confirmation', 'password');