Skip to content

Commit

Permalink
fix-form-validation (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
PerryvanderMeer authored Mar 4, 2024
1 parent b565557 commit 22c53b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions stubs/livewire-common/app/Livewire/Forms/LoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function authenticate(): void
RateLimiter::hit($this->throttleKey());

throw ValidationException::withMessages([
'email' => trans('auth.failed'),
'form.email' => trans('auth.failed'),
]);
}

Expand All @@ -55,7 +55,7 @@ protected function ensureIsNotRateLimited(): void
$seconds = RateLimiter::availableIn($this->throttleKey());

throw ValidationException::withMessages([
'email' => trans('auth.throttle', [
'form.email' => trans('auth.throttle', [
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div>
<x-input-label for="email" :value="__('Email')" />
<x-text-input wire:model="form.email" id="email" class="block mt-1 w-full" type="email" name="email" required autofocus autocomplete="username" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
<x-input-error :messages="$errors->get('form.email')" class="mt-2" />
</div>

<!-- Password -->
Expand All @@ -44,7 +44,7 @@
name="password"
required autocomplete="current-password" />

<x-input-error :messages="$errors->get('password')" class="mt-2" />
<x-input-error :messages="$errors->get('form.password')" class="mt-2" />
</div>

<!-- Remember Me -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function login(): void
<div>
<x-input-label for="email" :value="__('Email')" />
<x-text-input wire:model="form.email" id="email" class="block mt-1 w-full" type="email" name="email" required autofocus autocomplete="username" />
<x-input-error :messages="$errors->get('email')" class="mt-2" />
<x-input-error :messages="$errors->get('form.email')" class="mt-2" />
</div>

<!-- Password -->
Expand All @@ -46,7 +46,7 @@ public function login(): void
name="password"
required autocomplete="current-password" />

<x-input-error :messages="$errors->get('password')" class="mt-2" />
<x-input-error :messages="$errors->get('form.password')" class="mt-2" />
</div>

<!-- Remember Me -->
Expand Down

0 comments on commit 22c53b8

Please sign in to comment.