Skip to content

Commit

Permalink
use spatie/html for login form
Browse files Browse the repository at this point in the history
  • Loading branch information
fey committed Mar 12, 2024
1 parent 7cecfd6 commit aabcabf
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@
{{ __('layout.login.form_header') }}
</h1>
<div class="card-body">
{{ BsForm::open(route('login')) }}
{{ BsForm::email('email')->label(__('layout.login.email')) }}
{{ BsForm::password('password')->label(__('layout.login.password')) }}
{{ BsForm::checkbox('remember')->label(__('layout.login.remember_me')) }}
{{ BsForm::submit(__('layout.login.button'))->attribute('class', 'btn btn-primary btn-block') }}
<div class="mt-2">
@if (Route::has('password.request'))
<a href="{{ route('password.request') }}">
{{ __('layout.login.reset_password') }}
</a>
@endif
{{ html()->form('POST', route('login'))->open() }}
<div class="mb-3">
{{ html()->label(__('layout.login.email'))->for('email')->class('form-label') }}
{{ html()->email('email')->class(['form-control', 'is-invalid' => $errors->has('email')]) }}
@error('email')
<span class="invalid-feedback">{{ $errors->first('email') }}</span>
@enderror
</div>
{{ BsForm::close() }}
<div class="mb-3">
{{ html()->label(__('layout.login.password'))->for('password')->class('form-label') }}
{{ html()->password('password')->class(['form-control', 'is-invalid' => $errors->has('password')]) }}
@error('password')
<span class="invalid-feedback">{{ $errors->first('password') }}</span>
@enderror
</div>
<div class="mb-3 form-check">
{{ html()->checkbox('remember')->class('form-check-input') }}
{{ html()->label(__('layout.login.remember_me'))->for('remember')->class('form-label') }}
</div>
{{ html()->submit(__('layout.login.button'))->class('btn btn-primary btn-block') }}
<a class="mt-2 d-block" href="{{ route('password.request') }}">{{ __('layout.login.reset_password') }}</a>
{{ html()->form()->close() }}
</div>
<div class="card-footer p-4 text-center bg-transparent">
@include('components.social_login')
Expand Down

0 comments on commit aabcabf

Please sign in to comment.