From abf4212d5a4aabb5f90c378c0c1caec38c260d4f Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Wed, 13 Mar 2024 23:26:42 +0500 Subject: [PATCH] use spatie/html --- resources/lang/en/register.php | 1 + resources/lang/ru/register.php | 1 + resources/views/auth/login.blade.php | 2 +- .../views/auth/passwords/email.blade.php | 22 +++++++---- .../views/auth/passwords/reset.blade.php | 37 +++++++++++++------ resources/views/auth/register.blade.php | 8 ++-- 6 files changed, 46 insertions(+), 25 deletions(-) diff --git a/resources/lang/en/register.php b/resources/lang/en/register.php index 74b474476..6a382591f 100644 --- a/resources/lang/en/register.php +++ b/resources/lang/en/register.php @@ -8,4 +8,5 @@ 'password_confirmation' => 'Confirm password', 'submit' => 'Sign up', 'login' => 'Log in', + 'reset_password' => 'Forgot Your Password?', ]; diff --git a/resources/lang/ru/register.php b/resources/lang/ru/register.php index f260e5641..d3f07396c 100644 --- a/resources/lang/ru/register.php +++ b/resources/lang/ru/register.php @@ -8,4 +8,5 @@ 'password_confirmation' => 'Подтверждение пароля', 'submit' => 'Зарегистрироваться', 'login' => 'Войти', + 'reset_password' => 'Забыли пароль?', ]; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 3795d896e..4c937105a 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -7,7 +7,7 @@ {{ __('login.title') }}
- {{ html()->form('POST', route('login'))->open() }} + {{ html()->form()->route('login')->open() }}
{{ html()->label(__('login.email'))->for('email')->class('form-label') }} {{ html()->email('email')->class(['form-control', 'is-invalid' => $errors->has('email')]) }} diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 9d763d91e..7f4d57d5b 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -8,20 +8,26 @@ {{ __('passwords.reset_password.form_header') }}
+ @if($errors->any()) + + @endif @if (session('status')) @endif - - {{ BsForm::open(route('password.email')) }} - {{ BsForm::text('email')->label(__('passwords.reset_password.email')) }} - -
- {{ BsForm::submit(__('passwords.reset_password.button_send_link'))->attribute('class', 'btn btn-primary btn-block') }} + {{ html()->form()->action(route('password.email'))->open() }} +
+ {{ html()->label(__(__('passwords.reset_password.email')))->for('email')->class('form-label') }} + {{ html()->email('email')->class(['form-control', 'is-invalid' => $errors->has('email')]) }} + @error('email') + {{ $errors->first('email') }} + @enderror
- - {{ BsForm::close() }} + {{ html()->submit(__('passwords.reset_password.button_send_link'))->class('btn btn-primary btn-block') }} + {{ html()->form()->close() }}
diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index 144061dcb..4a109ce3b 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -7,19 +7,34 @@

{{ __('passwords.reset_password.form_header') }}

-
- {{ BsForm::open(route('password.update')) }} - {{ Form::hidden('token', $token) }} - {{ BsForm::text('email', $email ?? old('email'))->label(__('passwords.reset_password.email')) }} +
- {{ BsForm::password('password')->label(__('passwords.reset_password.password')) }} - {{ BsForm::password('password_confirmation')->label(__('passwords.reset_password.confirm_password')) }} - -
- {{ BsForm::submit(__('passwords.reset_password.button'))->attribute('class', 'btn btn-primary btn-block') }} + {{ html()->form()->action(route('password.update'))->open() }} + {{ html()->hidden('token')->value($token )}} +
+ {{ html()->label(__(__('passwords.reset_password.email')))->for('email')->class('form-label') }} + {{ html()->email('email')->class(['form-control', 'is-invalid' => $errors->has('email')]) }} + @error('email') + {{ $errors->first('email') }} + @enderror
- - {{ BsForm::close() }} +
+ {{ html()->label(__('passwords.reset_password.password'))->for('password')->class('form-label') }} + {{ html()->password('password')->class(['form-control', 'is-invalid' => $errors->has('password')]) }} @error('password') + {{ $errors->first('password') }} + @enderror +
+
+ {{ html()->label(__('passwords.reset_password.confirm_password'))->for('password')->class('form-label') }} + {{ html()->password('password_confirmation')->class(['form-control', 'is-invalid' => $errors->has('password_confirmation')]) }} + @error('password_confirmation') + {{ $errors->first('password_confirmation') }} + @enderror +
+
+ {{ html()->submit(__('passwords.reset_password.button'))->class('btn btn-primary btn-block') }} +
+ {{ html()->form()->close() }}
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index e349a1c79..1a1036b4b 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -4,12 +4,12 @@
-

+

{{ __('register.title') }}

- {{ html()->form('POST', route('register'))->open() }} + {{ html()->form()->route('register')->open() }} {{ html()->label(__('register.email'))->for('email')->class('form-label') }} {{ html()->email('email')->class(['form-control', 'is-invalid' => $errors->has('email')]) }} @error('email') @@ -17,7 +17,6 @@ @enderror
- {{ html()->form('POST', route('register'))->open() }} {{ html()->label(__('register.name'))->for('email')->class('form-label') }} {{ html()->text('name')->class(['form-control', 'is-invalid' => $errors->has('name')]) }} @error('name') @@ -25,7 +24,6 @@ @enderror
- {{ html()->form('POST', route('register'))->open() }} {{ html()->label(__('register.password'))->for('password')->class('form-label') }} {{ html()->password('password')->class(['form-control', 'is-invalid' => $errors->has('password')]) }} @error('password') @@ -33,7 +31,6 @@ @enderror
- {{ html()->form('POST', route('register'))->open() }} {{ html()->label(__('register.password_confirmation'))->for('password')->class('form-label') }} {{ html()->password('password_confirmation')->class(['form-control', 'is-invalid' => $errors->has('password_confirmation')]) }} @error('password_confirmation') @@ -45,6 +42,7 @@
{{ html()->form()->close() }}