reset password
This commit is contained in:
parent
c2e22b1dae
commit
7c804bf715
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Str;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
public function showLinkRequestForm()
|
||||
{
|
||||
return view('auth.forgot-password');
|
||||
}
|
||||
|
||||
public function sendResetLinkEmail(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'email' => 'required|email'
|
||||
]);
|
||||
|
||||
$status = Password::sendResetLink(
|
||||
$request->only('email')
|
||||
);
|
||||
|
||||
return $status === Password::RESET_LINK_SENT
|
||||
? back()->with('status', __($status))
|
||||
: back()->withErrors(['email' => __($status)]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\User;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
return view('auth.reset-password', [
|
||||
'token' => $token,
|
||||
'email' => $request->email
|
||||
]);
|
||||
}
|
||||
|
||||
public function reset(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|min:8|confirmed',
|
||||
]);
|
||||
|
||||
$status = Password::reset(
|
||||
$request->only('email', 'password', 'password_confirmation', 'token'),
|
||||
function ($user, $password) {
|
||||
$user->forceFill([
|
||||
'password' => Hash::make($password),
|
||||
'remember_token' => Str::random(60),
|
||||
])->save();
|
||||
}
|
||||
);
|
||||
|
||||
// return $status == Password::PASSWORD_RESET
|
||||
// ? redirect()->route('login')->with('status', 'Password berhasil direset!')
|
||||
// : back()->withErrors(['email' => [__($status)]]);
|
||||
return view('auth.reset-success');
|
||||
}
|
||||
}
|
||||
|
|
@ -294,7 +294,7 @@ public function ambilData(Request $request)
|
|||
|
||||
if (($validated['redirect_to'] ?? 'dashboard') === 'ulasan') {
|
||||
return redirect()->route('ulasan.index', array_filter($redirectParameters))
|
||||
->with('success', 'Data berhasil diambil dan dianalisis untuk ' . $lokasiLabel . ' periode ' . $periodeBulan->translatedFormat('F Y') . '.');
|
||||
->with('success', 'Data berhasil diambil' . $lokasiLabel . ' periode ' . $periodeBulan->translatedFormat('F Y') . '.');
|
||||
}
|
||||
|
||||
if (!empty($validated['wisata'])) {
|
||||
|
|
|
|||
|
|
@ -3,16 +3,28 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Auth\Notifications\ResetPassword;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
{
|
||||
ResetPassword::toMailUsing(function ($notifiable, string $token) {
|
||||
|
||||
$url = url(route(
|
||||
'password.reset',
|
||||
[
|
||||
'token' => $token,
|
||||
'email' => $notifiable->getEmailForPasswordReset(),
|
||||
],
|
||||
false
|
||||
));
|
||||
|
||||
return (new \Illuminate\Notifications\Messages\MailMessage)
|
||||
->subject('Reset Password SENTARA')
|
||||
->view('emails.reset-password', [
|
||||
'actionUrl' => $url
|
||||
]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,8 @@
|
|||
"barryvdh/laravel-dompdf": "^3.1",
|
||||
"laravel/framework": "^11.0",
|
||||
"laravel/tinker": "^2.10.1",
|
||||
"maatwebsite/excel": "^3.1"
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"nesbot/carbon": "^3.11"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.23",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "855b99e0c7cb480cba79f70700deeb58",
|
||||
"content-hash": "fceea29907dfa5352acade86e2cf7f27",
|
||||
"packages": [
|
||||
{
|
||||
"name": "barryvdh/laravel-dompdf",
|
||||
|
|
|
|||
|
|
@ -2,553 +2,70 @@
|
|||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Lupa Password - SENTARA</title>
|
||||
|
||||
@vite(['resources/css/app.css','resources/js/app.js'])
|
||||
|
||||
<style>
|
||||
body{
|
||||
background:#f5f7fb;
|
||||
font-family:'Poppins', sans-serif;
|
||||
}
|
||||
|
||||
.main-wrapper{
|
||||
min-height:100vh;
|
||||
padding:40px 20px;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
/* BACKGROUND */
|
||||
.circle-top{
|
||||
position:absolute;
|
||||
top:-120px;
|
||||
right:-120px;
|
||||
width:350px;
|
||||
height:350px;
|
||||
background:#edf3ff;
|
||||
border-radius:50%;
|
||||
z-index:0;
|
||||
}
|
||||
|
||||
.circle-bottom{
|
||||
position:absolute;
|
||||
bottom:-150px;
|
||||
left:-150px;
|
||||
width:320px;
|
||||
height:320px;
|
||||
background:#edf3ff;
|
||||
border-radius:50%;
|
||||
z-index:0;
|
||||
}
|
||||
|
||||
.content{
|
||||
position:relative;
|
||||
z-index:2;
|
||||
width:100%;
|
||||
max-width:950px;
|
||||
}
|
||||
|
||||
/* CARD */
|
||||
.card-box{
|
||||
background:#fff;
|
||||
border-radius:26px;
|
||||
padding:50px;
|
||||
box-shadow:0 10px 35px rgba(0,0,0,0.06);
|
||||
}
|
||||
|
||||
/* ICON */
|
||||
.icon-wrapper{
|
||||
width:110px;
|
||||
height:110px;
|
||||
background:#edf3ff;
|
||||
border-radius:50%;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
margin:0 auto 25px;
|
||||
}
|
||||
|
||||
/* TITLE */
|
||||
.title{
|
||||
text-align:center;
|
||||
font-size:54px;
|
||||
font-weight:700;
|
||||
color:#0d1b52;
|
||||
line-height:1.2;
|
||||
}
|
||||
|
||||
.subtitle{
|
||||
text-align:center;
|
||||
font-size:22px;
|
||||
color:#475569;
|
||||
margin-top:18px;
|
||||
line-height:1.7;
|
||||
}
|
||||
|
||||
.subtitle span{
|
||||
color:#2563eb;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
/* ALERT */
|
||||
.info-box{
|
||||
margin-top:35px;
|
||||
background:#f4f8ff;
|
||||
border:1px solid #dbeafe;
|
||||
border-radius:18px;
|
||||
padding:22px 24px;
|
||||
display:flex;
|
||||
align-items:flex-start;
|
||||
gap:16px;
|
||||
}
|
||||
|
||||
.info-box p{
|
||||
color:#334155;
|
||||
font-size:18px;
|
||||
line-height:1.6;
|
||||
}
|
||||
|
||||
/* SECTION */
|
||||
.section-title{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
gap:12px;
|
||||
margin-top:45px;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
|
||||
.section-title h2{
|
||||
font-size:34px;
|
||||
font-weight:700;
|
||||
color:#0d1b52;
|
||||
}
|
||||
|
||||
/* STEP */
|
||||
.step{
|
||||
display:flex;
|
||||
gap:20px;
|
||||
margin-bottom:28px;
|
||||
}
|
||||
|
||||
.step-number{
|
||||
min-width:52px;
|
||||
height:52px;
|
||||
background:#2563eb;
|
||||
color:#fff;
|
||||
border-radius:50%;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
font-weight:700;
|
||||
font-size:22px;
|
||||
}
|
||||
|
||||
.step-content h3{
|
||||
font-size:28px;
|
||||
font-weight:700;
|
||||
color:#0f172a;
|
||||
margin-bottom:6px;
|
||||
}
|
||||
|
||||
.step-content p{
|
||||
color:#475569;
|
||||
font-size:20px;
|
||||
line-height:1.7;
|
||||
}
|
||||
|
||||
/* CONTACT */
|
||||
.contact-box{
|
||||
margin-top:40px;
|
||||
background:#f8fbff;
|
||||
border:1px solid #e2e8f0;
|
||||
border-radius:22px;
|
||||
padding:32px;
|
||||
}
|
||||
|
||||
.contact-header{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
gap:18px;
|
||||
margin-bottom:18px;
|
||||
}
|
||||
|
||||
.contact-icon{
|
||||
width:70px;
|
||||
height:70px;
|
||||
background:#edf3ff;
|
||||
border-radius:50%;
|
||||
display:flex;
|
||||
align-items:center;
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
.contact-header h3{
|
||||
font-size:30px;
|
||||
font-weight:700;
|
||||
color:#2563eb;
|
||||
}
|
||||
|
||||
.contact-header p{
|
||||
font-size:18px;
|
||||
color:#475569;
|
||||
margin-top:4px;
|
||||
}
|
||||
|
||||
.contact-list{
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
gap:24px;
|
||||
align-items:center;
|
||||
margin-top:18px;
|
||||
padding-left:88px;
|
||||
}
|
||||
|
||||
.contact-item{
|
||||
display:flex;
|
||||
align-items:center;
|
||||
gap:12px;
|
||||
font-size:22px;
|
||||
font-weight:600;
|
||||
color:#0f172a;
|
||||
}
|
||||
|
||||
/* FOOTER */
|
||||
.footer{
|
||||
display:flex;
|
||||
justify-content:space-between;
|
||||
margin-top:28px;
|
||||
color:#64748b;
|
||||
font-size:18px;
|
||||
padding:0 8px;
|
||||
}
|
||||
|
||||
/* MOBILE */
|
||||
@media(max-width:768px){
|
||||
|
||||
.main-wrapper{
|
||||
padding:20px 14px;
|
||||
}
|
||||
|
||||
.card-box{
|
||||
padding:28px 22px;
|
||||
border-radius:22px;
|
||||
}
|
||||
|
||||
.icon-wrapper{
|
||||
width:90px;
|
||||
height:90px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size:36px;
|
||||
}
|
||||
|
||||
.subtitle{
|
||||
font-size:17px;
|
||||
line-height:1.7;
|
||||
}
|
||||
|
||||
.info-box{
|
||||
padding:18px;
|
||||
}
|
||||
|
||||
.info-box p{
|
||||
font-size:15px;
|
||||
}
|
||||
|
||||
.section-title h2{
|
||||
font-size:25px;
|
||||
}
|
||||
|
||||
.step{
|
||||
gap:14px;
|
||||
}
|
||||
|
||||
.step-number{
|
||||
min-width:42px;
|
||||
height:42px;
|
||||
font-size:18px;
|
||||
}
|
||||
|
||||
.step-content h3{
|
||||
font-size:21px;
|
||||
}
|
||||
|
||||
.step-content p{
|
||||
font-size:15px;
|
||||
}
|
||||
|
||||
.contact-box{
|
||||
padding:22px;
|
||||
}
|
||||
|
||||
.contact-header{
|
||||
align-items:flex-start;
|
||||
}
|
||||
|
||||
.contact-header h3{
|
||||
font-size:24px;
|
||||
}
|
||||
|
||||
.contact-header p{
|
||||
font-size:15px;
|
||||
}
|
||||
|
||||
.contact-list{
|
||||
padding-left:0;
|
||||
flex-direction:column;
|
||||
align-items:flex-start;
|
||||
gap:18px;
|
||||
}
|
||||
|
||||
.contact-item{
|
||||
font-size:16px;
|
||||
word-break:break-word;
|
||||
}
|
||||
|
||||
.footer{
|
||||
flex-direction:column;
|
||||
gap:10px;
|
||||
text-align:center;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-gray-100 min-h-screen flex items-center justify-center p-6">
|
||||
|
||||
<body>
|
||||
<div class="bg-white shadow-2xl rounded-3xl overflow-hidden grid md:grid-cols-2 max-w-5xl w-full">
|
||||
|
||||
<div class="main-wrapper">
|
||||
<div class="bg-blue-700 text-white p-10 flex flex-col justify-center">
|
||||
<img src="{{ asset('images/logo-sentara.png') }}" class="w-48 mb-8">
|
||||
|
||||
<div class="circle-top"></div>
|
||||
<div class="circle-bottom"></div>
|
||||
<h1 class="text-3xl font-bold mb-4">
|
||||
Lupa Password?
|
||||
</h1>
|
||||
|
||||
<div class="content">
|
||||
<p class="text-blue-100 leading-relaxed">
|
||||
Masukkan email akun Anda untuk menerima link reset password.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- CARD -->
|
||||
<div class="card-box">
|
||||
<div class="p-10">
|
||||
|
||||
<!-- ICON -->
|
||||
<div class="icon-wrapper">
|
||||
<h2 class="text-2xl font-bold text-gray-800 mb-2">
|
||||
Reset Password
|
||||
</h2>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="55"
|
||||
height="55"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="#2563eb"
|
||||
stroke-width="2">
|
||||
<p class="text-gray-500 mb-8">
|
||||
Kami akan mengirim link reset password ke email Anda.
|
||||
</p>
|
||||
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M16 11V7a4 4 0 10-8 0v4m-2 0h12a2 2 0 012 2v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5a2 2 0 012-2z"/>
|
||||
@if (session('status'))
|
||||
<div class="bg-green-100 text-green-700 p-4 rounded-xl mb-6">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<circle cx="18.5" cy="18.5" r="3.5" stroke="#2563eb"/>
|
||||
<path d="M18.5 17v3M17 18.5h3" stroke="#2563eb"/>
|
||||
</svg>
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block mb-2 font-medium text-gray-700">
|
||||
Email
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
class="w-full border rounded-xl px-4 py-3 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
placeholder="contoh@email.com"
|
||||
required
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- TITLE -->
|
||||
<h1 class="title">
|
||||
Lupa Password?
|
||||
</h1>
|
||||
<button
|
||||
type="submit"
|
||||
class="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 rounded-xl transition"
|
||||
>
|
||||
Kirim Link Reset
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p class="subtitle">
|
||||
Untuk keamanan akun, pengaturan ulang password hanya dapat dilakukan
|
||||
<br>
|
||||
<span>oleh Administrator.</span>
|
||||
</p>
|
||||
|
||||
<!-- INFO -->
|
||||
<div class="info-box">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="34"
|
||||
height="34"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="#2563eb"
|
||||
stroke-width="2">
|
||||
|
||||
<circle cx="12" cy="12" r="10"/>
|
||||
<path d="M12 16v-4"/>
|
||||
<path d="M12 8h.01"/>
|
||||
|
||||
</svg>
|
||||
|
||||
<p>
|
||||
Silakan hubungi Administrator sistem untuk memperbarui password akun Anda.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- SECTION TITLE -->
|
||||
<div class="section-title">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="40"
|
||||
height="40"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="#2563eb"
|
||||
stroke-width="2">
|
||||
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M17 20h5V4H2v16h5"/>
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M9 20h6"/>
|
||||
<circle cx="12" cy="8" r="3"/>
|
||||
<path d="M7 16c1.333-2 3-3 5-3s3.667 1 5 3"/>
|
||||
|
||||
</svg>
|
||||
|
||||
<h2>Cara Memperbarui Password</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- STEP -->
|
||||
<div class="step">
|
||||
|
||||
<div class="step-number">1</div>
|
||||
|
||||
<div class="step-content">
|
||||
<h3>Hubungi Administrator</h3>
|
||||
<p>
|
||||
Sampaikan kepada Administrator bahwa Anda lupa password akun SENTARA.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="step">
|
||||
|
||||
<div class="step-number">2</div>
|
||||
|
||||
<div class="step-content">
|
||||
<h3>Verifikasi Identitas</h3>
|
||||
<p>
|
||||
Administrator akan memverifikasi identitas Anda sebagai pengguna sistem.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="step">
|
||||
|
||||
<div class="step-number">3</div>
|
||||
|
||||
<div class="step-content">
|
||||
<h3>Password Baru</h3>
|
||||
<p>
|
||||
Administrator akan membuat password baru dan memberikannya kepada Anda.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- CONTACT -->
|
||||
<div class="contact-box">
|
||||
|
||||
<div class="contact-header">
|
||||
|
||||
<div class="contact-icon">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="38"
|
||||
height="38"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="#2563eb"
|
||||
stroke-width="2">
|
||||
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4-.917L2 17l1.083-3.25A6.963 6.963 0 012 10c0-3.866 3.582-7 8-7s8 3.134 8 7z"/>
|
||||
|
||||
<path d="M15 8h.01"/>
|
||||
<path d="M9 8h.01"/>
|
||||
<path d="M8 12c1 1 2 1.5 4 1.5s3-.5 4-1.5"/>
|
||||
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Kontak Administrator</h3>
|
||||
<p>
|
||||
Silakan hubungi administrator melalui kontak resmi berikut:
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="contact-list">
|
||||
|
||||
<!-- PHONE -->
|
||||
<div class="contact-item">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="26"
|
||||
height="26"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="#2563eb"
|
||||
stroke-width="2">
|
||||
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M3 5a2 2 0 012-2h2.28a2 2 0 011.94 1.515l.57 2.28a2 2 0 01-.45 1.91l-1.27 1.27a16 16 0 006.59 6.59l1.27-1.27a2 2 0 011.91-.45l2.28.57A2 2 0 0121 16.72V19a2 2 0 01-2 2h-1C9.163 21 3 14.837 3 7V5z"/>
|
||||
|
||||
</svg>
|
||||
|
||||
0881-0267-1527
|
||||
|
||||
</div>
|
||||
|
||||
<!-- EMAIL -->
|
||||
<div class="contact-item">
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="26"
|
||||
height="26"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="#2563eb"
|
||||
stroke-width="2">
|
||||
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M4 4h16v16H4z"/>
|
||||
|
||||
<path stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
d="M22 6l-10 7L2 6"/>
|
||||
|
||||
</svg>
|
||||
|
||||
e31231226@student.polije.ac.id
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<div class="footer">
|
||||
<div>© 2025 SENTARA. All rights reserved.</div>
|
||||
<div>Dinas Pariwisata Jember</div>
|
||||
<div class="mt-6 text-center">
|
||||
<a href="{{ route('login') }}" class="text-blue-600 hover:underline">
|
||||
Kembali ke Login
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,39 +1,183 @@
|
|||
<x-guest-layout>
|
||||
<form method="POST" action="{{ route('password.store') }}">
|
||||
@csrf
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Password Reset Token -->
|
||||
<input type="hidden" name="token" value="{{ $request->route('token') }}">
|
||||
<title>Reset Password - SENTARA</title>
|
||||
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<style>
|
||||
body{
|
||||
background:#f5f7fb;
|
||||
}
|
||||
|
||||
.left-panel{
|
||||
background: linear-gradient(180deg,#0f3fb9,#1546cf);
|
||||
}
|
||||
|
||||
.input-box{
|
||||
width:100%;
|
||||
border:1px solid #dbe3ef;
|
||||
border-radius:10px;
|
||||
padding:14px 16px;
|
||||
outline:none;
|
||||
}
|
||||
|
||||
.input-box:focus{
|
||||
border-color:#2563eb;
|
||||
box-shadow:0 0 0 3px rgba(37,99,235,.15);
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body class="min-h-screen flex items-center justify-center p-6">
|
||||
|
||||
<div class="bg-white rounded-3xl shadow-xl overflow-hidden max-w-5xl w-full grid md:grid-cols-2">
|
||||
|
||||
<!-- LEFT -->
|
||||
<div class="left-panel text-white p-10 flex flex-col justify-between">
|
||||
|
||||
<!-- Email Address -->
|
||||
<div>
|
||||
<x-input-label for="email" :value="__('Email')" />
|
||||
<x-text-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus autocomplete="username" />
|
||||
<x-input-error :messages="$errors->get('email')" class="mt-2" />
|
||||
|
||||
<img src="{{ asset('images/logo-sentara.png') }}"
|
||||
class="w-56 mb-10"
|
||||
alt="logo">
|
||||
|
||||
<h1 class="text-3xl font-bold mb-4">
|
||||
Buat Password Baru
|
||||
</h1>
|
||||
|
||||
<p class="text-blue-100 leading-7">
|
||||
Masukkan password baru Anda
|
||||
pada form di samping.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Password -->
|
||||
<div class="mt-4">
|
||||
<x-input-label for="password" :value="__('Password')" />
|
||||
<x-text-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
|
||||
<x-input-error :messages="$errors->get('password')" class="mt-2" />
|
||||
<div class="text-center mt-12 text-8xl">
|
||||
🔐
|
||||
</div>
|
||||
|
||||
<!-- Confirm Password -->
|
||||
<div class="mt-4">
|
||||
<x-input-label for="password_confirmation" :value="__('Confirm Password')" />
|
||||
</div>
|
||||
|
||||
<x-text-input id="password_confirmation" class="block mt-1 w-full"
|
||||
type="password"
|
||||
name="password_confirmation" required autocomplete="new-password" />
|
||||
<!-- RIGHT -->
|
||||
<div class="p-10">
|
||||
|
||||
<x-input-error :messages="$errors->get('password_confirmation')" class="mt-2" />
|
||||
</div>
|
||||
<h2 class="text-4xl font-bold text-slate-800 mb-3">
|
||||
Reset Password
|
||||
</h2>
|
||||
|
||||
<div class="flex items-center justify-end mt-4">
|
||||
<x-primary-button>
|
||||
{{ __('Reset Password') }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-guest-layout>
|
||||
<p class="text-slate-500 mb-8">
|
||||
Masukkan password baru untuk akun Anda.
|
||||
</p>
|
||||
|
||||
@if ($errors->any())
|
||||
<div class="bg-red-100 text-red-600 p-3 rounded-xl mb-5">
|
||||
{{ $errors->first() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('custom.password.update') }}">
|
||||
|
||||
@csrf
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="token"
|
||||
value="{{ $token ?? request()->route('token') }}">
|
||||
|
||||
<input type="hidden"
|
||||
name="email"
|
||||
value="{{ $email ?? request()->email }}">
|
||||
|
||||
<!-- PASSWORD -->
|
||||
|
||||
{{-- Password Baru --}}
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
Password Baru
|
||||
</label>
|
||||
|
||||
<div class="relative">
|
||||
<input
|
||||
id="password"
|
||||
type="password"
|
||||
name="password"
|
||||
placeholder="Masukkan password baru"
|
||||
required
|
||||
class="w-full border rounded-lg px-4 py-3 pr-12 focus:ring-2 focus:ring-blue-500 outline-none"
|
||||
>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick="togglePassword('password','eye1')"
|
||||
class="absolute right-4 top-1/2 -translate-y-1/2 text-gray-500"
|
||||
>
|
||||
<span id="eye1">👁️</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p class="text-xs text-gray-400 mt-1">
|
||||
Minimal 8 karakter
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Konfirmasi Password --}}
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">
|
||||
Konfirmasi Password
|
||||
</label>
|
||||
|
||||
<div class="relative">
|
||||
<input
|
||||
id="password_confirmation"
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
placeholder="Konfirmasi password baru"
|
||||
required
|
||||
class="w-full border rounded-lg px-4 py-3 pr-12 focus:ring-2 focus:ring-blue-500 outline-none"
|
||||
>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick="togglePassword('password_confirmation','eye2')"
|
||||
class="absolute right-4 top-1/2 -translate-y-1/2 text-gray-500"
|
||||
>
|
||||
<span id="eye2">👁️</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="w-full bg-blue-600 hover:bg-blue-700 transition text-white py-4 rounded-xl font-semibold shadow-lg">
|
||||
|
||||
🔒 Reset Password
|
||||
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function togglePassword(inputId, eyeId) {
|
||||
const input = document.getElementById(inputId);
|
||||
const eye = document.getElementById(eyeId);
|
||||
|
||||
if (input.type === "password") {
|
||||
input.type = "text";
|
||||
eye.innerHTML = "🙈";
|
||||
} else {
|
||||
input.type = "password";
|
||||
eye.innerHTML = "👁️";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Password Berhasil Direset</title>
|
||||
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-[#f5f7fb] min-h-screen flex items-center justify-center px-4">
|
||||
|
||||
<div class="w-full max-w-md bg-white rounded-2xl shadow-lg p-8 text-center">
|
||||
|
||||
<div class="flex justify-center mb-5">
|
||||
<div class="w-20 h-20 rounded-full bg-green-100 flex items-center justify-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-[#1e3a8a] mb-3">
|
||||
Password Berhasil Direset
|
||||
</h2>
|
||||
|
||||
<p class="text-gray-500 mb-6">
|
||||
Password akun Anda berhasil diperbarui. Silakan login kembali menggunakan password baru.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href="{{ url('/login') }}"
|
||||
class="inline-block bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-xl font-semibold transition duration-200"
|
||||
>
|
||||
Kembali ke Login
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,196 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Reset Password SENTARA</title>
|
||||
|
||||
<style>
|
||||
body{
|
||||
margin:0;
|
||||
padding:0;
|
||||
background:#f4f7ff;
|
||||
font-family:Arial, sans-serif;
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
width:100%;
|
||||
padding:40px 15px;
|
||||
}
|
||||
|
||||
.card{
|
||||
max-width:650px;
|
||||
margin:auto;
|
||||
background:white;
|
||||
border-radius:20px;
|
||||
overflow:hidden;
|
||||
box-shadow:0 10px 30px rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
.header{
|
||||
background:linear-gradient(135deg,#3B82F6,#4F46E5);
|
||||
padding:35px;
|
||||
text-align:center;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.logo{
|
||||
font-size:34px;
|
||||
font-weight:bold;
|
||||
letter-spacing:2px;
|
||||
}
|
||||
|
||||
.subtitle{
|
||||
margin-top:10px;
|
||||
opacity:.9;
|
||||
}
|
||||
|
||||
.content{
|
||||
padding:40px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.icon{
|
||||
font-size:70px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size:34px;
|
||||
font-weight:bold;
|
||||
color:#1e293b;
|
||||
}
|
||||
|
||||
.desc{
|
||||
color:#64748b;
|
||||
line-height:1.7;
|
||||
margin-top:20px;
|
||||
}
|
||||
|
||||
.btn{
|
||||
display:inline-block;
|
||||
margin-top:30px;
|
||||
background:#3B82F6;
|
||||
color:white !important;
|
||||
text-decoration:none;
|
||||
padding:15px 40px;
|
||||
border-radius:10px;
|
||||
font-weight:bold;
|
||||
font-size:16px;
|
||||
}
|
||||
|
||||
.info-box{
|
||||
margin-top:35px;
|
||||
background:#eef4ff;
|
||||
padding:20px;
|
||||
border-radius:12px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
.info-box strong{
|
||||
color:#2563eb;
|
||||
}
|
||||
|
||||
.footer{
|
||||
padding:25px;
|
||||
text-align:center;
|
||||
color:#94a3b8;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.link-box{
|
||||
margin-top:25px;
|
||||
background:#0f172a;
|
||||
color:white;
|
||||
padding:20px;
|
||||
border-radius:12px;
|
||||
word-break:break-all;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="header">
|
||||
|
||||
<div class="logo">
|
||||
SENTARA
|
||||
</div>
|
||||
|
||||
<div class="subtitle">
|
||||
Sistem Analisis Sentimen Pariwisata Jember
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="icon">
|
||||
🔐
|
||||
</div>
|
||||
|
||||
<div class="title">
|
||||
Reset Password
|
||||
</div>
|
||||
|
||||
<p class="desc">
|
||||
|
||||
Halo,<br><br>
|
||||
|
||||
Kami menerima permintaan reset password untuk akun Anda.
|
||||
Klik tombol di bawah untuk membuat password baru.
|
||||
|
||||
</p>
|
||||
|
||||
<a class="btn" href="{{ $actionUrl }}">
|
||||
Reset Password
|
||||
</a>
|
||||
|
||||
<div class="info-box">
|
||||
|
||||
⏰ Link reset password akan kadaluarsa dalam
|
||||
<strong>60 menit</strong>.
|
||||
|
||||
<br><br>
|
||||
|
||||
Jika Anda tidak meminta reset password,
|
||||
abaikan email ini.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="link-box">
|
||||
|
||||
Jika tombol tidak berfungsi, salin link berikut:
|
||||
|
||||
<br><br>
|
||||
|
||||
{{ $actionUrl }}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="footer">
|
||||
|
||||
© {{ date('Y') }} SENTARA <br>
|
||||
|
||||
Email otomatis — jangan membalas email ini.
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<body class="bg-gray-100 overflow-x-hidden">
|
||||
|
||||
<div class="min-h-screen flex">
|
||||
<div class="h-auto ">
|
||||
|
||||
<!-- SIDEBAR -->
|
||||
<aside id="sidebar"
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
use App\Http\Controllers\Auth\ConfirmablePasswordController;
|
||||
use App\Http\Controllers\Auth\EmailVerificationNotificationController;
|
||||
use App\Http\Controllers\Auth\EmailVerificationPromptController;
|
||||
use App\Http\Controllers\Auth\NewPasswordController;
|
||||
use App\Http\Controllers\Auth\PasswordController;
|
||||
use App\Http\Controllers\Auth\PasswordResetLinkController;
|
||||
use App\Http\Controllers\Auth\RegisteredUserController;
|
||||
use App\Http\Controllers\Auth\VerifyEmailController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware('guest')->group(function () {
|
||||
|
||||
Route::get('register', [RegisteredUserController::class, 'create'])
|
||||
->name('register');
|
||||
|
||||
|
|
@ -22,20 +21,15 @@
|
|||
|
||||
Route::post('login', [AuthenticatedSessionController::class, 'store']);
|
||||
|
||||
Route::get('forgot-password', [PasswordResetLinkController::class, 'create'])
|
||||
->name('password.request');
|
||||
|
||||
Route::post('forgot-password', [PasswordResetLinkController::class, 'store'])
|
||||
->name('password.email');
|
||||
|
||||
Route::get('reset-password/{token}', [NewPasswordController::class, 'create'])
|
||||
->name('password.reset');
|
||||
|
||||
Route::post('reset-password', [NewPasswordController::class, 'store'])
|
||||
->name('password.store');
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| RESET PASSWORD BAWAAN DIHAPUS
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
});
|
||||
|
||||
Route::middleware('auth')->group(function () {
|
||||
|
||||
Route::get('verify-email', EmailVerificationPromptController::class)
|
||||
->name('verification.notice');
|
||||
|
||||
|
|
@ -43,17 +37,31 @@
|
|||
->middleware(['signed', 'throttle:6,1'])
|
||||
->name('verification.verify');
|
||||
|
||||
Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store'])
|
||||
->middleware('throttle:6,1')
|
||||
->name('verification.send');
|
||||
Route::post(
|
||||
'email/verification-notification',
|
||||
[EmailVerificationNotificationController::class, 'store']
|
||||
)
|
||||
->middleware('throttle:6,1')
|
||||
->name('verification.send');
|
||||
|
||||
Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
|
||||
->name('password.confirm');
|
||||
Route::get(
|
||||
'confirm-password',
|
||||
[ConfirmablePasswordController::class, 'show']
|
||||
)
|
||||
->name('password.confirm');
|
||||
|
||||
Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
|
||||
Route::post(
|
||||
'confirm-password',
|
||||
[ConfirmablePasswordController::class, 'store']
|
||||
);
|
||||
|
||||
Route::put('password', [PasswordController::class, 'update'])->name('password.update');
|
||||
Route::put(
|
||||
'password',
|
||||
[PasswordController::class, 'update']
|
||||
)->name('password.update');
|
||||
|
||||
Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
|
||||
->name('logout');
|
||||
});
|
||||
Route::post(
|
||||
'logout',
|
||||
[AuthenticatedSessionController::class, 'destroy']
|
||||
)->name('logout');
|
||||
});
|
||||
|
|
@ -7,6 +7,8 @@
|
|||
use App\Http\Controllers\AnalisisController;
|
||||
use App\Http\Controllers\RekomendasiController;
|
||||
use App\Http\Controllers\UserController;
|
||||
use App\Http\Controllers\Auth\ForgotPasswordController;
|
||||
use App\Http\Controllers\Auth\ResetPasswordController;
|
||||
|
||||
|
||||
|
||||
|
|
@ -16,6 +18,22 @@
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
Route::get('/forgot-password',
|
||||
[ForgotPasswordController::class, 'showLinkRequestForm'])
|
||||
->name('password.request');
|
||||
|
||||
Route::post('/forgot-password',
|
||||
[ForgotPasswordController::class, 'sendResetLinkEmail'])
|
||||
->name('password.email');
|
||||
|
||||
Route::get('/reset-password/{token}',
|
||||
[ResetPasswordController::class, 'showResetForm'])
|
||||
->name('password.reset');
|
||||
|
||||
Route::post('/reset-password-custom',
|
||||
[ResetPasswordController::class, 'reset'])
|
||||
->name('custom.password.update');
|
||||
|
||||
Route::get('/', function () {
|
||||
return redirect('/login');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Password Berhasil Direset</title>
|
||||
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-[#f5f7fb] min-h-screen flex items-center justify-center px-4">
|
||||
|
||||
<div class="w-full max-w-md bg-white rounded-2xl shadow-lg p-8 text-center">
|
||||
|
||||
<div class="flex justify-center mb-5">
|
||||
<div class="w-20 h-20 rounded-full bg-green-100 flex items-center justify-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10 text-green-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-[#1e3a8a] mb-3">
|
||||
Password Berhasil Direset
|
||||
</h2>
|
||||
|
||||
<p class="text-gray-500 mb-6">
|
||||
Password akun Anda berhasil diperbarui. Silakan login kembali menggunakan password baru.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href="<?php echo e(url('/login')); ?>"
|
||||
class="inline-block bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-xl font-semibold transition duration-200"
|
||||
>
|
||||
Kembali ke Login
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html><?php /**PATH C:\laragon\www\SistemAnalisisSentimen\resources\views/auth/reset-success.blade.php ENDPATH**/ ?>
|
||||
|
|
@ -1,442 +0,0 @@
|
|||
<?php $__env->startSection('content'); ?>
|
||||
|
||||
<div class="space-y-6">
|
||||
|
||||
|
||||
<?php if(session('success')): ?>
|
||||
<div class="bg-green-50 border border-green-200 text-green-700 px-5 py-4 rounded-2xl">
|
||||
<?php echo e(session('success')); ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if(session('error')): ?>
|
||||
<div class="bg-red-50 border border-red-200 text-red-700 px-5 py-4 rounded-2xl">
|
||||
<?php echo e(session('error')); ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- HEADER -->
|
||||
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
|
||||
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-slate-800">Kelola Pengguna</h1>
|
||||
<p class="text-slate-500 mt-1">Kelola akun pengguna sistem SENTARA.</p>
|
||||
</div>
|
||||
|
||||
<!-- BUTTON TAMBAH -->
|
||||
<button
|
||||
onclick="openTambahModal()"
|
||||
class="bg-blue-600 hover:bg-blue-700 text-white px-5 py-3 rounded-2xl text-sm font-semibold shadow transition">
|
||||
+ Tambah Pengguna
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- CARD -->
|
||||
<div class="bg-white rounded-3xl shadow-sm border border-slate-100 p-5">
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="overflow-x-auto mt-6">
|
||||
|
||||
<table class="w-full text-sm min-w-[900px]">
|
||||
|
||||
<thead>
|
||||
<tr class="text-slate-500 border-b">
|
||||
<th class="py-4 text-left">No</th>
|
||||
<th class="py-4 text-left">Nama</th>
|
||||
<th class="py-4 text-left">Email</th>
|
||||
<th class="py-4 text-left">Role</th>
|
||||
<th class="py-4 text-left">Status</th>
|
||||
<th class="py-4 text-left">Terakhir Aktif</th>
|
||||
<th class="py-4 text-center">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="text-slate-700">
|
||||
|
||||
<?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||
|
||||
<tr class="border-b hover:bg-slate-50 transition">
|
||||
|
||||
<td class="py-4"><?php echo e($loop->iteration); ?></td>
|
||||
|
||||
<td class="py-4">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center text-xs font-bold text-slate-600">
|
||||
<?php echo e(strtoupper(substr($user->name, 0, 2))); ?>
|
||||
|
||||
</div>
|
||||
<span class="font-medium"><?php echo e($user->name); ?></span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="py-4"><?php echo e($user->email); ?></td>
|
||||
|
||||
<td class="py-4">
|
||||
<?php if($user->role == 'admin'): ?>
|
||||
<span class="bg-purple-100 text-purple-700 px-3 py-1 rounded-full text-xs font-semibold">Admin</span>
|
||||
<?php else: ?>
|
||||
<span class="bg-blue-100 text-blue-700 px-3 py-1 rounded-full text-xs font-semibold">Staff</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
<td class="py-4">
|
||||
<span class="bg-green-100 text-green-700 px-3 py-1 rounded-full text-xs font-semibold">Aktif</span>
|
||||
</td>
|
||||
|
||||
<td class="py-4"><?php echo e($user->updated_at->format('d M Y, H:i')); ?></td>
|
||||
|
||||
<td class="py-4">
|
||||
<div class="flex justify-center gap-2">
|
||||
|
||||
<button
|
||||
onclick="openEditModal('<?php echo e($user->id); ?>', '<?php echo e(addslashes($user->name)); ?>', '<?php echo e($user->email); ?>', '<?php echo e($user->role); ?>')"
|
||||
class="w-11 h-11 rounded-2xl border border-blue-200 text-blue-600 hover:bg-blue-50 flex items-center justify-center transition"
|
||||
title="Edit Pengguna">✏️</button>
|
||||
|
||||
<button
|
||||
onclick="openPasswordModal('<?php echo e($user->id); ?>')"
|
||||
class="w-11 h-11 rounded-2xl border border-amber-200 text-amber-500 hover:bg-amber-50 flex items-center justify-center transition"
|
||||
title="Reset Password">🔒</button>
|
||||
|
||||
<button
|
||||
onclick="openDeleteModal('<?php echo e($user->id); ?>', '<?php echo e($user->role); ?>')"
|
||||
class="w-11 h-11 rounded-2xl border border-red-200 text-red-500 hover:bg-red-50 flex items-center justify-center transition"
|
||||
title="Hapus Pengguna">🗑️</button>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||
|
||||
<tr>
|
||||
<td colspan="7" class="py-10 text-center text-slate-400">
|
||||
Data pengguna belum tersedia.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- PAGINATION -->
|
||||
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4 mt-6">
|
||||
<p class="text-sm text-slate-500">
|
||||
Menampilkan <?php echo e($users->firstItem() ?? 0); ?> - <?php echo e($users->lastItem() ?? 0); ?>
|
||||
|
||||
dari <?php echo e($users->total()); ?> pengguna
|
||||
</p>
|
||||
<?php echo e($users->links()); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ================= MODAL TAMBAH PENGGUNA ================= -->
|
||||
<div id="tambahModal"
|
||||
class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center px-4">
|
||||
|
||||
<div class="bg-white rounded-3xl p-6 shadow-2xl w-full" style="max-width: 480px;">
|
||||
|
||||
<div class="flex items-start justify-between mb-5">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-slate-800">Tambah Pengguna</h2>
|
||||
<p class="text-slate-500 text-sm mt-1">Buat akun pengguna baru untuk sistem SENTARA.</p>
|
||||
</div>
|
||||
<button onclick="closeTambahModal()"
|
||||
class="text-slate-400 hover:text-slate-700 text-2xl leading-none ml-4 flex-shrink-0">×</button>
|
||||
</div>
|
||||
|
||||
|
||||
<form method="POST" action="/kelola-pengguna" id="tambahForm">
|
||||
|
||||
<?php echo csrf_field(); ?>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Nama Pengguna</label>
|
||||
<input type="text" name="name" placeholder="Masukkan nama lengkap"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Email</label>
|
||||
<input type="email" name="email" placeholder="contoh@email.com"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Role Pengguna</label>
|
||||
<select name="role"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none">
|
||||
<option value="staff">Staff</option>
|
||||
<option value="admin">Admin</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Password</label>
|
||||
<input type="password" name="password" placeholder="Minimal 8 karakter"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Konfirmasi Password</label>
|
||||
<input type="password" name="password_confirmation" placeholder="Ulangi password"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none" required>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<button type="button" onclick="closeTambahModal()"
|
||||
class="flex-1 py-3 rounded-2xl border border-slate-200 text-slate-600 text-sm font-medium hover:bg-slate-100 transition">
|
||||
Batal
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="flex-1 py-3 rounded-2xl bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold transition">
|
||||
Tambah
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ================= MODAL EDIT ================= -->
|
||||
<div id="editModal"
|
||||
class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center px-4">
|
||||
|
||||
<div class="bg-white rounded-3xl p-6 shadow-2xl w-full" style="max-width: 480px;">
|
||||
|
||||
<div class="flex items-start justify-between mb-5">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-slate-800">Edit Pengguna</h2>
|
||||
<p class="text-slate-500 text-sm mt-1">Perbarui informasi akun pengguna SENTARA.</p>
|
||||
</div>
|
||||
<button onclick="closeEditModal()"
|
||||
class="text-slate-400 hover:text-slate-700 text-2xl leading-none ml-4 flex-shrink-0">×</button>
|
||||
</div>
|
||||
|
||||
<form method="POST" id="editForm">
|
||||
<?php echo csrf_field(); ?>
|
||||
<?php if($errors->any()): ?>
|
||||
<div class="mb-4 rounded-2xl bg-red-50 border border-red-200 text-red-600 px-4 py-3 text-sm">
|
||||
<?php echo e($errors->first()); ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo method_field('PUT'); ?>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Nama Pengguna</label>
|
||||
<input type="text" name="name" id="editName"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none">
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Email</label>
|
||||
<input type="email" name="email" id="editEmail"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none">
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Role Pengguna</label>
|
||||
<select name="role" id="editRole"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-blue-500 focus:outline-none">
|
||||
<option value="admin">Admin</option>
|
||||
<option value="staff">Staff</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<button type="button" onclick="closeEditModal()"
|
||||
class="flex-1 py-3 rounded-2xl border border-slate-200 text-slate-600 text-sm font-medium hover:bg-slate-100 transition">
|
||||
Batal
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="flex-1 py-3 rounded-2xl bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold transition">
|
||||
Simpan
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ================= MODAL RESET PASSWORD ================= -->
|
||||
<div id="passwordModal"
|
||||
class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center px-4">
|
||||
|
||||
<div class="bg-white rounded-3xl p-6 shadow-2xl w-full" style="max-width: 480px;">
|
||||
|
||||
<div class="flex items-start justify-between mb-5">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-slate-800">Reset Password</h2>
|
||||
<p class="text-slate-500 text-sm mt-1">Buat password baru pengguna.</p>
|
||||
</div>
|
||||
<button onclick="closePasswordModal()"
|
||||
class="text-slate-400 hover:text-slate-700 text-2xl leading-none ml-4 flex-shrink-0">×</button>
|
||||
</div>
|
||||
|
||||
<div class="mb-5 bg-amber-50 border border-amber-200 rounded-2xl p-4">
|
||||
<p class="text-sm text-amber-700 leading-relaxed">
|
||||
Password minimal 8 karakter dan harus kombinasi huruf besar, huruf kecil, dan angka.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form method="POST" id="passwordForm">
|
||||
<?php echo csrf_field(); ?>
|
||||
<?php echo method_field('PUT'); ?>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Password Baru</label>
|
||||
<input type="password" name="password"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-amber-400 focus:outline-none">
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-semibold text-slate-700 mb-2">Konfirmasi Password</label>
|
||||
<input type="password" name="password_confirmation"
|
||||
class="w-full rounded-2xl border border-slate-200 px-4 py-3 text-sm focus:ring-2 focus:ring-amber-400 focus:outline-none">
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3">
|
||||
<button type="button" onclick="closePasswordModal()"
|
||||
class="flex-1 py-3 rounded-2xl border border-slate-200 text-slate-600 text-sm font-medium hover:bg-slate-100 transition">
|
||||
Batal
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="flex-1 py-3 rounded-2xl bg-amber-500 hover:bg-amber-600 text-white text-sm font-semibold transition">
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ================= MODAL DELETE ================= -->
|
||||
<div id="deleteModal"
|
||||
class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center px-4">
|
||||
|
||||
<div class="bg-white rounded-3xl p-6 shadow-2xl w-full text-center" style="max-width: 400px;">
|
||||
|
||||
<div class="w-16 h-16 mx-auto rounded-full bg-red-100 flex items-center justify-center text-3xl mb-4">🗑️</div>
|
||||
<h2 class="text-2xl font-bold text-slate-800">Hapus Pengguna?</h2>
|
||||
<p class="text-slate-500 text-sm mt-2 leading-relaxed">
|
||||
Data pengguna akan dihapus permanen dan tidak dapat dikembalikan.
|
||||
</p>
|
||||
|
||||
<form method="POST" id="deleteForm" class="mt-6">
|
||||
<?php echo csrf_field(); ?>
|
||||
<?php echo method_field('DELETE'); ?>
|
||||
<div class="flex gap-3">
|
||||
<button type="button" onclick="closeDeleteModal()"
|
||||
class="flex-1 py-3 rounded-2xl border border-slate-200 text-slate-600 text-sm font-medium hover:bg-slate-100 transition">
|
||||
Batal
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="flex-1 py-3 rounded-2xl bg-red-500 hover:bg-red-600 text-white text-sm font-semibold transition">
|
||||
Hapus
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ================= MODAL ADMIN TIDAK BISA DIHAPUS ================= -->
|
||||
<div id="adminAlertModal"
|
||||
class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center px-4">
|
||||
|
||||
<div class="bg-white rounded-3xl p-6 shadow-2xl w-full text-center" style="max-width: 400px;">
|
||||
|
||||
<div class="w-16 h-16 mx-auto rounded-full bg-amber-100 flex items-center justify-center text-3xl mb-4">⚠️</div>
|
||||
<h2 class="text-2xl font-bold text-slate-800">Akses Ditolak</h2>
|
||||
<p class="text-slate-500 text-sm mt-2 leading-relaxed">
|
||||
Akun administrator tidak dapat dihapus demi menjaga keamanan sistem.
|
||||
</p>
|
||||
|
||||
<button onclick="closeAdminAlertModal()"
|
||||
class="w-full mt-6 py-3 rounded-2xl bg-blue-600 hover:bg-blue-700 text-white text-sm font-semibold transition">
|
||||
Mengerti
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ================= SCRIPT ================= -->
|
||||
<script>
|
||||
|
||||
/* ---- TAMBAH ---- */
|
||||
function openTambahModal() {
|
||||
document.getElementById('tambahModal').classList.remove('hidden');
|
||||
document.getElementById('tambahForm').reset();
|
||||
}
|
||||
function closeTambahModal() {
|
||||
document.getElementById('tambahModal').classList.add('hidden');
|
||||
}
|
||||
|
||||
/* ---- EDIT ---- */
|
||||
function openEditModal(id, name, email, role) {
|
||||
document.getElementById('editModal').classList.remove('hidden');
|
||||
document.getElementById('editName').value = name;
|
||||
document.getElementById('editEmail').value = email;
|
||||
document.getElementById('editRole').value = role;
|
||||
document.getElementById('editForm').action = '/kelola-pengguna/' + id;
|
||||
}
|
||||
function closeEditModal() {
|
||||
document.getElementById('editModal').classList.add('hidden');
|
||||
}
|
||||
|
||||
/* ---- RESET PASSWORD ---- */
|
||||
function openPasswordModal(id) {
|
||||
document.getElementById('passwordModal').classList.remove('hidden');
|
||||
document.getElementById('passwordForm').action =
|
||||
'/kelola-pengguna/' + id + '/reset-password';
|
||||
}
|
||||
function closePasswordModal() {
|
||||
document.getElementById('passwordModal').classList.add('hidden');
|
||||
}
|
||||
|
||||
/* ---- DELETE ---- */
|
||||
function openDeleteModal(id, role) {
|
||||
if (role === 'admin') {
|
||||
document.getElementById('adminAlertModal').classList.remove('hidden');
|
||||
return;
|
||||
}
|
||||
document.getElementById('deleteModal').classList.remove('hidden');
|
||||
document.getElementById('deleteForm').action = '/kelola-pengguna/' + id;
|
||||
}
|
||||
function closeDeleteModal() {
|
||||
document.getElementById('deleteModal').classList.add('hidden');
|
||||
}
|
||||
function closeAdminAlertModal() {
|
||||
document.getElementById('adminAlertModal').classList.add('hidden');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php $__env->stopSection(); ?>
|
||||
<?php echo $__env->make('layouts.sentara', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\SistemAnalisisSentimen\resources\views/kelolauser/index.blade.php ENDPATH**/ ?>
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>Reset Password - SENTARA</title>
|
||||
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<style>
|
||||
body{
|
||||
background:#f5f7fb;
|
||||
}
|
||||
|
||||
.left-panel{
|
||||
background: linear-gradient(180deg,#0f3fb9,#1546cf);
|
||||
}
|
||||
|
||||
.input-box{
|
||||
width:100%;
|
||||
border:1px solid #dbe3ef;
|
||||
border-radius:10px;
|
||||
padding:14px 16px;
|
||||
outline:none;
|
||||
}
|
||||
|
||||
.input-box:focus{
|
||||
border-color:#2563eb;
|
||||
box-shadow:0 0 0 3px rgba(37,99,235,.15);
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body class="min-h-screen flex items-center justify-center p-6">
|
||||
|
||||
<div class="bg-white rounded-3xl shadow-xl overflow-hidden max-w-5xl w-full grid md:grid-cols-2">
|
||||
|
||||
<!-- LEFT -->
|
||||
<div class="left-panel text-white p-10 flex flex-col justify-between">
|
||||
|
||||
<div>
|
||||
|
||||
<img src="<?php echo e(asset('images/logo-sentara.png')); ?>"
|
||||
class="w-56 mb-10"
|
||||
alt="logo">
|
||||
|
||||
<h1 class="text-3xl font-bold mb-4">
|
||||
Buat Password Baru
|
||||
</h1>
|
||||
|
||||
<p class="text-blue-100 leading-7">
|
||||
Masukkan password baru Anda
|
||||
pada form di samping.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="text-center mt-12 text-8xl">
|
||||
🔐
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- RIGHT -->
|
||||
<div class="p-10">
|
||||
|
||||
<h2 class="text-4xl font-bold text-slate-800 mb-3">
|
||||
Reset Password
|
||||
</h2>
|
||||
|
||||
<p class="text-slate-500 mb-8">
|
||||
Masukkan password baru untuk akun Anda.
|
||||
</p>
|
||||
|
||||
<?php if($errors->any()): ?>
|
||||
<div class="bg-red-100 text-red-600 p-3 rounded-xl mb-5">
|
||||
<?php echo e($errors->first()); ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST" action="<?php echo e(route('custom.password.update')); ?>">
|
||||
|
||||
<?php echo csrf_field(); ?>
|
||||
|
||||
|
||||
<input type="hidden"
|
||||
name="token"
|
||||
value="<?php echo e($token ?? request()->route('token')); ?>">
|
||||
|
||||
<input type="hidden"
|
||||
name="email"
|
||||
value="<?php echo e($email ?? request()->email); ?>">
|
||||
|
||||
<!-- PASSWORD -->
|
||||
|
||||
<div class="mb-6">
|
||||
|
||||
<label class="font-semibold block mb-2">
|
||||
Password Baru
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="password"
|
||||
name="password"
|
||||
placeholder="Masukkan password baru"
|
||||
class="input-box"
|
||||
required
|
||||
>
|
||||
|
||||
<small class="text-gray-400">
|
||||
Minimal 8 karakter
|
||||
</small>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- CONFIRM -->
|
||||
|
||||
<div class="mb-8">
|
||||
|
||||
<label class="font-semibold block mb-2">
|
||||
Konfirmasi Password
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="password"
|
||||
name="password_confirmation"
|
||||
placeholder="Konfirmasi password baru"
|
||||
class="input-box"
|
||||
required
|
||||
>
|
||||
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="w-full bg-blue-600 hover:bg-blue-700 transition text-white py-4 rounded-xl font-semibold shadow-lg">
|
||||
|
||||
🔒 Reset Password
|
||||
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html><?php /**PATH C:\laragon\www\SistemAnalisisSentimen\resources\views/auth/reset-password.blade.php ENDPATH**/ ?>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<body class="bg-gray-100 overflow-x-hidden">
|
||||
|
||||
<div class="min-h-screen flex">
|
||||
<div class="h-auto ">
|
||||
|
||||
<!-- SIDEBAR -->
|
||||
<aside id="sidebar"
|
||||
|
|
|
|||
Loading…
Reference in New Issue