Passage à Laravel 10 pour Fortify Bootstrap

This commit is contained in:
hugol
2024-08-11 15:38:19 +02:00
parent f28e5700e8
commit 0c4e5538db
96 changed files with 16694 additions and 1962 deletions

View File

@@ -0,0 +1,28 @@
@extends('layouts.app')
@section('content')
<div class="container">
@if (session('status'))
<div class="fixed-top" style="z-index: 1000000">
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ session('status') }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
</div>
@endif
<div class="row justify-content-center">
<div class="col-md-8">
<h2 class="my-3">{{ __('Profile') }}</h2>
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::updateProfileInformation()))
@include('profile.update-profile-information-form')
@endif
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::updatePasswords()))
@include('profile.update-password-form')
@endif
@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::twoFactorAuthentication()))
@include('profile.two-factor-authentication-form')
@endif
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,66 @@
<div class="card mb-3">
<div class="card-header">
{{ __('Two Factor Authentication') }}
</div>
<div class="card-body">
<p class="mt-3">
{{ __('Add additional security to your account using two factor authentication.') }}
</p>
<div class="mt-3">
<h4>
@if (auth()->user()->two_factor_secret)
{{ __('You have enabled two factor authentication.') }}
@else
{{ __('You have not enabled two factor authentication.') }}
@endif
</h4>
<p class="mt-2">
{{ __('When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone\'s Google Authenticator application.') }}
</p>
@if (!auth()->user()->two_factor_secret)
<form method="POST" action="{{ url('user/two-factor-authentication') }}">
@csrf
<button type="submit" class="btn btn-dark">
{{ __('Enable Two-Factor') }}
</button>
</form>
@else
<form method="POST" action="{{ url('user/two-factor-authentication') }}">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger">
{{ __('Disable Two-Factor') }}
</button>
</form>
@if (session('status') == 'two-factor-authentication-enabled')
<div class="mt-2">
{{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }}
</div>
<div class="my-2">
{!! auth()
->user()
->twoFactorQrCodeSvg() !!}
</div>
@endif
<div class="mt-2">
{{ __('Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.') }}
</div>
<div class="mt-2 p-3 bg-gray">
@foreach (json_decode(decrypt(auth()->user()->two_factor_recovery_codes), true) as $code)
<pre>{{ $code }}</pre>
@endforeach
</div>
<form method="POST" action="{{ url('user/two-factor-recovery-codes') }}">
@csrf
<button type="submit" class="btn btn-primary">
{{ __('Regenerate Recovery Codes') }}
</button>
</form>
@endif
</div>
</div>
</div>

View File

@@ -0,0 +1,67 @@
<div class="card mb-4">
<div class="card-header">
{{ __('Update Password') }}
</div>
<div class="card-body">
<p>
{{ __('Ensure your account is using a long, random password to stay secure.') }}
</p>
<div class="mt-3">
<form action="{{ route('user-password.update') }}" method="POST">
@csrf
@method('PUT')
<div class="row mb-3">
<label for="current_password"
class="col-md-4 col-form-label text-md-right">{{ __('Current Password') }}</label>
<div class="col-md-6">
<input id="current_password" type="password"
class="form-control @error('current_password') is-invalid @enderror" name="current_password"
required autocomplete="current-password" placeholder="{{ __('Current Password') }}">
@error('current_password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password"
class="form-control @error('password') is-invalid @enderror" name="password" required
autocomplete="new-password" placeholder="{{ __('Password') }}">
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label for="confirm_password"
class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
<div class="col-md-6">
<input id="password_confirmation" type="password" class="form-control"
name="password_confirmation" required autocomplete="new-password"
placeholder="{{ __('Confirm Password') }}">
</div>
</div>
<div class="row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Save') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>

View File

@@ -0,0 +1,54 @@
<div class="card mb-4">
<div class="card-header">
{{ __('Profile Information') }}
</div>
<div class="card-body">
<p>
{{ __('Update your account\'s profile information and email address.') }}
</p>
<div class="mt-3">
<form action="{{ route('user-profile-information.update') }}" method="POST">
@csrf
@method('PUT')
<div class="row mb-3">
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror"
name="name" value="{{ old('name') ?? auth()->user()->name }}" required autocomplete="name">
@error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror"
name="email" value="{{ old('name') ?? auth()->user()->email }}" required
autocomplete="email">
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Update Profile') }}
</button>
</div>
</div>
</form>
</div>
</div>
</div>