master_template/resources/views/hulaki_khabar/Auth/login.blade.php
2024-06-13 21:02:05 +05:45

102 lines
4.1 KiB
PHP

@extends('hulaki_khabar.layout.layout')
@section('content')
<div class="page-title-area">
<div class="container">
<div class="page-title-content">
<h2>लगइन</h2>
<ul>
<li><a href="index.php">होमपेज</a></li>
<li>लगइन</li>
</ul>
</div>
</div>
</div>
<!-- End Page Banner -->
<!-- Start Login Area -->
<section class="login-area ptb-50">
<div class="container">
<div class="login-form">
<h2>लगइन फर्म</h2>
<form>
<div class="form-group">
<label>युजरनेम</label>
<input type="text" class="form-control" placeholder="युजरनेम">
</div>
<div class="form-group">
<label>पासवर्ड </label>
<input type="text" class="form-control" placeholder="पासवर्ड">
</div>
<div class="row align-items-center">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="form-check">
<input type="checkbox" class="form-check-input" id="checkme">
<label class="form-check-label" for="checkme"> याद राख्नुहोस</label>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 lost-your-password">
<a href="#" class="lost-your-password">पासवर्ड बिर्सिनुभयो?</a>
</div>
</div>
<button type="submit">लगइन</button>
</form>
<div class="important-text">
<p>खाता छैन? <a href="{{route('userRegister')}}">रजिस्टर गर्नुहोस !</a></p>
</div>
</div>
</div>
</section>
@endsection
@push('js')
<script>
$(document).ready(function() {
$('#login-form').submit(function(e) {
e.preventDefault();
var form = $(this);
let email = $('#email').val();
let password = $('#password').val();
let rememberme = $('#remember-me').val();
$.ajax({
type: 'POST',
url: form.attr('action'),
data: {
email: email,
password: password,
remember_me: rememberme,
_token: "{{ csrf_token() }}"
},
success: function(response) {
if (response.success) {
Swal.fire({
icon: 'success',
title: 'Success',
text: response.message
}).then((result) => {
if (result.isConfirmed) {
window.location.href = response.redirect_url;
}
});
} else {
Swal.fire({
icon: 'error',
title: 'Error',
text: response.message
});
}
},
error: function(xhr, status, error) {
let err = JSON.parse(xhr.responseText);
Swal.fire({
icon: 'error',
title: 'Error',
text: err.message || 'An error occurred during the request.'
});
}
});
});
});
</script>
@endpush