PHP code example of ikechukwukalu / sanctumauthstarter
1. Go to this page and download the library: Download ikechukwukalu/sanctumauthstarter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ikechukwukalu / sanctumauthstarter example snippets
js
window.addEventListener('DOMContentLoaded', () => {
if (localStorage.getItem('user_uuid')) {
localStorage.removeItem('user_uuid');
}
});
php
<form method="get">
@php
foreach ($_GET as $key => $value) {
$key = htmlspecialchars($key);
$value = htmlspecialchars($value);
echo "<input type='hidden' name='$key' value='$value'/>";
}
@endphp
@csrf
<p class="text-center">
{{ trans('two-factor::messages.continue') }}
</p>
<div class="form-row justify-content-center py-3">
@if($errors->isNotEmpty() || isset($message))
<div class="col-12 alert alert-danger pb-0">
<ul>
@if (isset($message))
<li>{{ $message }}</li>
@endif
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="col-sm-8 col-8 mb-3">
<input type="text" name="{{ $input }}" id="{{ $input }}"
class="@error($input) is-invalid @enderror form-control form-control-lg"
minlength="6" placeholder="123456"