login.blade.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. use App\Livewire\Forms\LoginForm;
  3. use Illuminate\Support\Facades\Session;
  4. use Livewire\Attributes\Layout;
  5. use Livewire\Volt\Component;
  6. new #[Layout('layouts.guest')] class extends Component
  7. {
  8. public LoginForm $form;
  9. /**
  10. * Handle an incoming authentication request.
  11. */
  12. public function login(): void
  13. {
  14. $this->validate();
  15. $this->form->authenticate();
  16. Session::regenerate();
  17. $this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
  18. }
  19. }; ?>
  20. <div>
  21. <!-- Session Status -->
  22. <x-auth-session-status class="mb-4" :status="session('status')" />
  23. <form wire:submit="login">
  24. <!-- Email Address -->
  25. <div>
  26. <x-input-label for="email" :value="__('Email')" />
  27. <x-text-input wire:model="form.email" id="email" class="block mt-1 w-full" type="email" name="email" required autofocus autocomplete="username" />
  28. <x-input-error :messages="$errors->get('form.email')" class="mt-2" />
  29. </div>
  30. <!-- Password -->
  31. <div class="mt-4">
  32. <x-input-label for="password" :value="__('Password')" />
  33. <x-text-input wire:model="form.password" id="password" class="block mt-1 w-full"
  34. type="password"
  35. name="password"
  36. required autocomplete="current-password" />
  37. <x-input-error :messages="$errors->get('form.password')" class="mt-2" />
  38. </div>
  39. <!-- Remember Me -->
  40. <div class="block mt-4">
  41. <label for="remember" class="inline-flex items-center">
  42. <input wire:model="form.remember" id="remember" type="checkbox" class="rounded dark:bg-gray-900 border-gray-300 dark:border-gray-700 text-indigo-600 shadow-sm focus:ring-indigo-500 dark:focus:ring-indigo-600 dark:focus:ring-offset-gray-800" name="remember">
  43. <span class="ms-2 text-sm text-gray-600 dark:text-gray-400">{{ __('Remember me') }}</span>
  44. </label>
  45. </div>
  46. <div class="flex items-center justify-end mt-4">
  47. @if (Route::has('password.request'))
  48. <a class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800" href="{{ route('password.request') }}" wire:navigate>
  49. {{ __('Forgot your password?') }}
  50. </a>
  51. @endif
  52. <x-primary-button class="ms-3">
  53. {{ __('Log in') }}
  54. </x-primary-button>
  55. </div>
  56. </form>
  57. </div>