From f8fd24b64fb711a1b98a6077b8788c65647e2df4 Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Sun, 25 Sep 2022 16:56:07 +0800 Subject: [PATCH 1/4] add function forgot password-reset password --- app/Http/Controllers/HomeController.php | 72 +++++++++ app/Http/Controllers/LelongController.php | 17 +- app/Http/Controllers/LogoutController.php | 41 +++++ app/Http/Controllers/MarhunController.php | 10 +- app/Http/Controllers/PembidaController.php | 66 +++++--- app/Http/Controllers/UserController.php | 146 ++++++++++++++++++ app/Mail/ResetPassword.php | 44 ++++++ app/Models/User.php | 2 + .../2014_10_12_000000_create_users_table.php | 4 +- public/css/neon.css | 2 +- resources/views/about.blade.php | 8 +- .../views/auth/change-password.blade.php | 88 +++++++++++ .../views/auth/forgot-password.blade.php | 81 ++++++++++ resources/views/auth/login.blade.php | 16 ++ resources/views/includes/header.blade.php | 11 +- .../pembida/senlelbelumbayarbidaan.blade.php | 36 +++-- .../views/pengesahan/mutumarhun.blade.php | 6 +- resources/views/profil.blade.php | 60 +++++++ .../views/template/reset-password.blade.php | 82 ++++++++++ resources/views/tukarkatalaluan.blade.php | 82 ++++++++++ resources/views/welcome.blade.php | 3 + routes/web.php | 13 ++ 22 files changed, 844 insertions(+), 46 deletions(-) create mode 100644 app/Http/Controllers/LogoutController.php create mode 100644 app/Http/Controllers/UserController.php create mode 100644 app/Mail/ResetPassword.php create mode 100644 resources/views/auth/change-password.blade.php create mode 100644 resources/views/auth/forgot-password.blade.php create mode 100644 resources/views/profil.blade.php create mode 100644 resources/views/template/reset-password.blade.php create mode 100644 resources/views/tukarkatalaluan.blade.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 66d9ba5b..810ec05a 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -14,6 +14,7 @@ use App\Models\Pengesahan; use Carbon\Carbon; use App\Models\Cawangan; use App\Models\LelongBid; +use Hash; class HomeController extends Controller { @@ -181,4 +182,75 @@ class HomeController extends Controller return view('home',compact('lelong', 'arrayinfo')); } + + public function editprofile() + { + // $user = Auth::user(); + // $user->assignRole('admin'); + return view('profil'); + } + + public function profileUpdate(Request $request){ + //validation rules + + $request->validate([ + 'name' =>'required|min:4|string|max:255', + 'username' =>'required|min:4|string|max:255', + 'email'=>'required|email|string|max:255' + ]); + $user =Auth::user(); + $user->name = $request['name']; + $user->email = $request['email']; + $user->save(); + return back()->with('message','Profil Telah Kemaskini'); + } + public function tukarkatalaluan() + { + // $user = Auth::user(); + // $user->assignRole('admin'); + return view('tukarkatalaluan'); + } + public function tukarkatalaluanupdate(Request $request){ + //validation rules + + $request->validate([ + 'name' =>'required|min:4|string|max:255', + 'username' =>'required|min:4|string|max:255', + 'email'=>'required|email|string|max:255' + ]); + $user =Auth::user(); + $user->name = $request['name']; + $user->email = $request['email']; + $user->save(); + return back()->with('message','Profil Telah Kemaskini'); + } + + public function showChangePasswordGet() { + return view('tukarkatalaluan'); + } + + public function changePasswordPost(Request $request) { + if (!(Hash::check($request->get('current-password'), Auth::user()->password))) { + // The passwords matches + return redirect()->back()->with("error","Katalaluan Lama Tidak Sama Dengan katalaluan."); + } + + if(strcmp($request->get('current-password'), $request->get('new-password')) == 0){ + // Current password and new password same + return redirect()->back()->with("error","Katalaluan Baru Tidak Boleh Sama Dengan Katalaluan Lama."); + } + + $validatedData = $request->validate([ + 'current-password' => 'required', + 'new-password' => 'required|string|min:8|confirmed', + ]); + + //Change Password + $user = Auth::user(); + $user->password = bcrypt($request->get('new-password')); + $user->save(); + + return redirect()->back()->with("success","Katalaluan Berjaya Dikemaskini!"); + } + } diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index 06d9b047..b7c4423a 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -99,6 +99,7 @@ class LelongController extends Controller ->select('cawangan.caw_name', 'cawangan.caw_code', 'cawangan.id') ->where('lelong.id', $lelongid) ->get(); + // dd($lelongbycaw); foreach ($lelongbycaw as $index => $data) { $lelongbycaw[$index]['lelong'] = $lelong->toArray(); @@ -107,13 +108,21 @@ class LelongController extends Controller ->where('lelongbid.caw_id', $data['id']) ->where('status_jual', 1) ->where('lelongbidder.status_bidder', 1) - ->where('lelongbidder.status_payment', 1) + // ->where('lelongbidder.status_payment', 1) ->get(); + // dd($lelongbid); - foreach ($lelongbid as $index2 => $value) { - $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $value['id']) - ->get(); + foreach ($lelongbid as $index2 => $value) + { + $lelongbidmarhun = LelongBidMarhun::where('lelongbid_id', $value['id'])->get(); $lelongbid[$index2]['lelongbidmarhun'] = $lelongbidmarhun->toArray(); + + $insertbatchlel = Http::withOptions(['verify' => config('app.api_verify')]) + ->post(config('app.api_url').'taglel/update',[ + 'kodcaw'=>$cawsimulasi['cawangan']->caw_code, + 'norujukan'=>$data->norujukan + ]) + ->json(); } $lelongbycaw[$index]['lelongbid'] = $lelongbid->toArray(); } diff --git a/app/Http/Controllers/LogoutController.php b/app/Http/Controllers/LogoutController.php new file mode 100644 index 00000000..4e7620df --- /dev/null +++ b/app/Http/Controllers/LogoutController.php @@ -0,0 +1,41 @@ +middleware('auth'); + } + + /** + * Show the application dashboard. + * + * @return \Illuminate\Contracts\Support\Renderable + */ + public function logout(Request $request) { + Auth::logout(); + return redirect('/login'); + } +} diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index b4145503..968cd6e5 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -24,6 +24,7 @@ use App\Models\GadaiMarhun; use App\Models\ScanSemak; use App\Models\TangguhLelong; use Carbon\Carbon; +use App\Models\ScanMarhun; class MarhunController extends Controller { @@ -129,10 +130,11 @@ class MarhunController extends Controller ->where('status_ubah', 6) ->first(); - $statusSemakMarhun = ScanMarhun::where('lelongbid_id', $bid['id']) + $statusSemakMarhun = ScanSemak::where('lelongbid_id', $bid['id']) ->whereNotNull('masa_terima') ->whereNull('masa_serah') ->first(); + dd($statusSemakMarhun); if ($statusSemakMarhun) { $lelongbid[$index1]['statusterimamarhun'] = 1; } @@ -839,14 +841,14 @@ class MarhunController extends Controller $gadai = GadaiMarhun::on($datagadai[0]['kodcaw'])->whereIn('norujukan', $arraygadai) ->get()->toArray(); - foreach($gadai as $index1=>$gadai2) + foreach($gadai as $index2=>$gadai2) { $listgadai = GadaiMarhun::on($datagadai[0]['kodcaw'])->whereIn('norujukan', $arraygadai) ->get(); - + $gadai[$index2]['listgadai'] = $listgadai; } - $gadai[$index1]['listgadai'] = $listgadai; + // $gadai[$index2]['listgadai'] = $listgadai; // dd($gadai); $arraylelbidmarhun = []; $bakilelong = 0; diff --git a/app/Http/Controllers/PembidaController.php b/app/Http/Controllers/PembidaController.php index bbef43fa..bd2a1cd4 100644 --- a/app/Http/Controllers/PembidaController.php +++ b/app/Http/Controllers/PembidaController.php @@ -215,31 +215,59 @@ class PembidaController extends Controller public function senlelbelumbayarbidaan(Request $request) { - //$kodcaw = $request->kodcaw; + // //$kodcaw = $request->kodcaw; - //$arrayinfo = []; + // //$arrayinfo = []; - $lelong = LelongBid::join('cawangan_lelong','lelongbid.lelong_id','=','cawangan_lelong.lelong_id') - ->join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id') - ->join('lelong','lelong.id','=','lelongbid.lelong_id') - ->join('cawangan','cawangan.id','=','lelongbid.caw_id') - ->select('lelongbid.lelong_id','lelongbid.caw_id','lelongbid.kodcaw','lelongbid.t_lelong','lelong.sts_lelong','cawangan.caw_name') + // $lelong = LelongBid::join('cawangan_lelong','lelongbid.lelong_id','=','cawangan_lelong.lelong_id') + // ->join('lelongbidder','lelongbid.id','=','lelongbidder.lelongbid_id') + // ->join('lelong','lelong.id','=','lelongbid.lelong_id') + // ->join('cawangan','cawangan.id','=','lelongbid.caw_id') + // ->select('lelongbid.lelong_id','lelongbid.caw_id','lelongbid.kodcaw','lelongbid.t_lelong','lelong.sts_lelong','cawangan.caw_name') + // ->distinct() + // ->orderBy('lelongbid.lelong_id') + // ->where('lelongbid.status_jual', 1) + // ->where('lelong.sts_lelong', 3) + // ->where(function($query){ + // $query->whereNull('lelongbidder.status_payment') + // ->orWhere('lelongbidder.status_payment',2) + // ->where('lelongbidder.status_bidder', 1); + // }) + // ->get(); + // //->toArray(); + // dd($lelong); + + $kodcaw = $request->kodcaw; + + + $arrayinfo = []; + + $lelong = Lelong::join('cawangan_lelong','lelong.id','=','cawangan_lelong.lelong_id') + ->select('lelong_id','tarikh_lelong','lelong.fasa','harga_emas_asas','jbg','cajlelong','sts_lelong') ->distinct() - ->orderBy('lelongbid.lelong_id') - ->where('lelongbid.status_jual', 1) - ->where('lelong.sts_lelong', 3) - ->where(function($query){ - $query->whereNull('lelongbidder.status_payment') - ->orWhere('lelongbidder.status_payment',2) - ->where('lelongbidder.status_bidder', 1); - }) - ->get(); - //->toArray(); - //dd($lelong); + ->orderBy('lelong_id') + ->where('lelong.sts_lelong', 3) + ->get() + ->toArray(); + + foreach($lelong as $details) + { + + $detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id') + ->select('cawangan_lelong.lelong_id','cawangan_lelong.caw_id','caw_name','caw_code','cawangan_lelong.export_data_sts') + ->where('lelong_id',$details['lelong_id']) + ->distinct() + ->orderBy('lelong_id') + ->get() + ->toArray(); + // dd($detailsinfo); + + array_push($arrayinfo,['detail'=>$details, 'detailsinfo'=>$detailsinfo]); + } - return view('pembida.senlelbelumbayarbidaan', compact('lelong')); + return view('pembida.senlelbelumbayarbidaan', compact('lelong','arrayinfo')); } public function pembayaranbidaan(Request $request) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php new file mode 100644 index 00000000..d4f27acd --- /dev/null +++ b/app/Http/Controllers/UserController.php @@ -0,0 +1,146 @@ +validate($request, [ + 'name' => 'required', + 'email' => 'required|email', + 'password' => 'required|min:6' + ]); + + User::create([ + 'name' => $request->name, + 'email' => $request->email, + 'password' => Hash::make($request->password) + ]); + } + + /** + * Login page + * @param NA + * @return view + */ + public function login() + { + return view('auth.login'); + } + + /** + * User Login + * @param request + * @return response + */ + public function loginValidate(Request $request) + { + $this->validate($request, [ + 'email' => 'required|email', + 'password' => 'required|min:6' + ]); + + $user = User::where('email', $request->email)->first(); + if ($user) { + if (Hash::check($request->password, $user->password)) { + return back()->with('success', 'Success! You are logged in'); + } + return back()->with('failed', 'Failed! Invalid password'); + } + return back()->with('failed', 'Failed! Invalid email'); + } + + /** + * Forgot password + * @param NA + * @return view + */ + public function forgotPassword() + { + return view('auth.forgot-password'); + } + + /** + * Validate token for forgot password + * @param token + * @return view + */ + public function forgotPasswordValidate($token) + { + $user = User::where('token', $token)->where('is_verified', 0)->first(); + // dd($user); + if ($user) { + $email = $user->email; + return view('auth.change-password', compact('email')); + } + return redirect()->route('forgot-password')->with('failed', 'Password reset link is expired'); + } + + /** + * Reset password + * @param request + * @return response + */ + public function resetPassword(Request $request) + { + $this->validate($request, [ + 'email' => 'required|email', + ]); + + $user = User::where('email', $request->email)->first(); + // dd($user); + if (!$user) { + return back()->with('failed', 'Gagal! Alamat Ini Belum Didaftarkan.'); + } + + $token = Str::random(60); + + $user['token'] = $token; + $user['is_verified'] = 0; + $user->save(); + + Mail::to($request->email)->send(new ResetPassword($user->name, $token)); + + if(Mail::failures() != 0) { + return back()->with('success', 'Berjaya DiHantar! Pautan Lupa Katalaluan Telah Dihantarkan Kepada Alamat Emel Anda.'); + } + return back()->with('failed', 'Failed! there is some issue with email provider'); + } + + /** + * Change password + * @param request + * @return response + */ + public function updatePassword(Request $request) { + $this->validate($request, [ + 'email' => 'required', + 'password' => 'required|min:6', + 'confirm_password' => 'required|same:password' + ]); + + $user = User::where('email', $request->email)->first(); + if ($user) { + $user['is_verified'] = 0; + $user['token'] = ''; + $user['password'] = Hash::make($request->password); + $user->save(); + return redirect()->route('login')->with('success', 'Berjaya! Katalaluan Anda Telah Didaftarkan.'); + } + return redirect()->route('forgot-password')->with('failed', 'Gadal! Sila Cuba Lagi...'); + } +} \ No newline at end of file diff --git a/app/Mail/ResetPassword.php b/app/Mail/ResetPassword.php new file mode 100644 index 00000000..b4522c6d --- /dev/null +++ b/app/Mail/ResetPassword.php @@ -0,0 +1,44 @@ +name = $name; + $this->token = $token; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + // return $this->view('view.name'); + $user['name'] = $this->name; + $user['token'] = $this->token; + + return $this->from("zatizul@gmail.com", "TESTING") + ->subject('Password Reset Link') + ->view('template.reset-password', ['user' => $user]); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index e830feef..778a821c 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -24,6 +24,8 @@ class User extends Authenticatable 'username', 'email', 'password', + 'token', + 'is_verified', 'kodcaw', 'nokp', 'bank_acc_pembeli', diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index f35acd62..482142fa 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -29,7 +29,9 @@ class CreateUsersTable extends Migration $table->datetime('t_daftar')->nullable(); $table->integer('online')->nullable(); //set $table->integer('register_agree')->nullable(); - $table->string('email')->nullable(); + $table->string('email')->unique(); + $table->string('token')->nullable(); + $table->tinyInteger('is_verified')->default(0); $table->datetime('email_verified_at')->nullable(); $table->string('password'); $table->datetime('disahkan_pada')->nullable(); diff --git a/public/css/neon.css b/public/css/neon.css index f17c1fb3..0145998c 100644 --- a/public/css/neon.css +++ b/public/css/neon.css @@ -74,7 +74,7 @@ body { line-height: 1.8; color: #efefef; text-align: left; - background-color: #111; } + background-color: rgb(176, 166, 166); } [tabindex="-1"]:focus { outline: 0 !important; } diff --git a/resources/views/about.blade.php b/resources/views/about.blade.php index c3805ad6..ec699e64 100644 --- a/resources/views/about.blade.php +++ b/resources/views/about.blade.php @@ -5,7 +5,7 @@
-
{{ __('Dashboard') }}
+
{{ __('Kemaskini Profil') }}
@if (session('status')) @@ -14,8 +14,8 @@
@endif - About page->role-> - @hasrole('admin') + Kemaskini Maklumat Profil + {{-- @hasrole('admin') I am a admin! @endhasrole @hasrole('khazanah') @@ -41,7 +41,7 @@ @endhasrole @hasrole('pengurus-cawangan-khas') I am a pengurus-cawangan-khas! - @endhasrole + @endhasrole --}}
diff --git a/resources/views/auth/change-password.blade.php b/resources/views/auth/change-password.blade.php new file mode 100644 index 00000000..e9b64a4c --- /dev/null +++ b/resources/views/auth/change-password.blade.php @@ -0,0 +1,88 @@ + + + + + + + AOS + + + + + + + + + + + + +
+
+
+
+ @csrf + @method('PUT') +
+ + @if (Session::has("success")) +
+ + {{ Session::get('success') }} +
+ @elseif (Session::has("failed")) +
+ + {{ Session::get('failed') }} +
+ @endif + +
+

Tukar Katalaluan

+
+ +
+ + + +
+ + + {!! $errors->first('password', '
:message
') !!} +
+ +
+ + + {!! $errors->first('confirm_password', '
:message
') !!} +
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php new file mode 100644 index 00000000..0cd62fe0 --- /dev/null +++ b/resources/views/auth/forgot-password.blade.php @@ -0,0 +1,81 @@ + + + + + + + AOS + + + + + + + + + + + + +
+
+
+
+ @csrf +
+ + @if (Session::has("success")) +
+ + {{ Session::get('success') }} +
+ @elseif (Session::has("failed")) +
+ + {{ Session::get('failed') }} +
+ @endif + +
+

Lupa Katalaluan

+
+ +
+
+ + + {!! $errors->first('email', '
:message
') !!} +
+ + {{--
--}} + Kembali Ke Log Masuk + {{--
--}} +
+ + +
+
+
+
+
+ + + \ No newline at end of file diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 2f6dfd9f..f637217b 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -41,6 +41,17 @@ {{ $message }} @enderror --}} + @if (Session::has("success")) +
+ + {{ Session::get('success') }} +
+ @elseif (Session::has("failed")) +
+ + {{ Session::get('failed') }} +
+ @endif @error('username') {{ $message }} @@ -60,12 +71,17 @@ Sila Baca Terma Dan Syarat Terlebih Dahulu Klik Disini +
+ {{-- Log Masuk --}}
+ diff --git a/resources/views/includes/header.blade.php b/resources/views/includes/header.blade.php index d7c07d53..a3feb404 100644 --- a/resources/views/includes/header.blade.php +++ b/resources/views/includes/header.blade.php @@ -24,7 +24,16 @@ @endif + @@ -17,33 +18,48 @@ + + + + - - @foreach($lelong as $index=> $lel) + @foreach($arrayinfo as $lel) - + + + + + - @endforeach diff --git a/resources/views/pengesahan/mutumarhun.blade.php b/resources/views/pengesahan/mutumarhun.blade.php index 8a85fbb7..879e2b20 100644 --- a/resources/views/pengesahan/mutumarhun.blade.php +++ b/resources/views/pengesahan/mutumarhun.blade.php @@ -49,6 +49,7 @@ + {{-- {{dd($arraylelbidmarhun)}} --}} @foreach($arraylelbidmarhun as $index1=>$detail) @@ -73,7 +74,7 @@ {{-- --}} - +
ID Lelong Tarikh Lelong CawanganStatus ExportHarga Emas SemasaTempohCaj Lelong Status Lelong
{{ $loop->iteration }}{{ $lel['lelong_id']}}{{ $lel['detail']['lelong_id']}} @php - $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['t_lelong'] ); + $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['detail']['tarikh_lelong'] ); $t_lelong = $myDateTime->format('d-m-Y'); echo($t_lelong); @endphp - - - {{ $lel['caw_name']}} + @foreach($lel['detailsinfo'] as $details) + + {{ $details['caw_name']}}
- + @endforeach
+ @foreach($lel['detailsinfo'] as $details) + @if($details['export_data_sts'] == '1') + Selesai Export + + @endif + +
+ @endforeach +
{{ $lel['detail']['harga_emas_asas'] }}{{ $lel['detail']['jbg'] }}{{ $lel['detail']['cajlelong'] }} - @if($lel['sts_lelong'] == 3) + @if($lel['detail']['sts_lelong'] == 3) @endif
{{ $loop->iteration }} {{ number_format($detail[0]['harga_gadai'], 2, '.', ',') }} {{ number_format ($gadai[0]['harga'], 2, '.', ',') }}{{ number_format ($gadai[$index1]['harga'], 2, '.', ',') }} @if($detail[0]['old_harga'] != $detail[0]['harga']) {{ number_format($detail[0]['old_harga'], 2, '.', ',') }} @@ -81,7 +82,8 @@ {{ number_format($detail[0]['harga'], 2, '.', ',') }} - {{ number_format($detail[0]['nmarhun_gadai'], 2, '.', ',') }} + {{-- {{ number_format($detail[0]['nmarhun_gadai'], 2, '.', ',') }} --}} + {{ number_format($gadai[$index1]['n_marhun'], 2, '.', ',') }} @if($detail[0]['old_nmarhun'] != $detail[0]['n_marhun']) diff --git a/resources/views/profil.blade.php b/resources/views/profil.blade.php new file mode 100644 index 00000000..dd136fc1 --- /dev/null +++ b/resources/views/profil.blade.php @@ -0,0 +1,60 @@ +@extends('layouts.app') + +@section('content') +
+ @if ($errors->any()) +
+
    + @foreach($errors->all() as $error) +
  • + {{$error}} +
  • + @endforeach +
+
+ @endif + @if(session()->get('message')) + + @endif +
+
+
+
{{Auth::user()->name}}'s Profil
+ +
+ @if (session('status')) + + @endif + @if($message = Session::get('success')) +
+

{{$message}}

+
+ @endif +
+ @csrf +
+ + +
+
+ + +
+
+ + +
+ + +
+
+ +
+
+
+
+@endsection diff --git a/resources/views/template/reset-password.blade.php b/resources/views/template/reset-password.blade.php new file mode 100644 index 00000000..c63c9ed8 --- /dev/null +++ b/resources/views/template/reset-password.blade.php @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + +
+ + + + + + + +
+ Sistem Lelong Online +
+ + + + +
+

+ Hello {{ $user ? $user['name'] : '' }}, +

+ Kami telah menerima permintaan untuk menetapkan semula kata laluan. +

+

+ Anda boleh menetapkan semula kata laluan anda dengan mengklik butang di bawah: +

+ +

+ Tukar Katalaluan Anda +

+ + +

+ Terima Kasih,

+

+ Sistem Lelong Online

+
+
+
+ + \ No newline at end of file diff --git a/resources/views/tukarkatalaluan.blade.php b/resources/views/tukarkatalaluan.blade.php new file mode 100644 index 00000000..2afd54d3 --- /dev/null +++ b/resources/views/tukarkatalaluan.blade.php @@ -0,0 +1,82 @@ +@extends('layouts.app') + +@section('content') +
+
+ +
+
+
+
+

Tukar Katalaluan

+ +
+ @if (session('error')) +
+ {{ session('error') }} +
+ @endif + @if (session('success')) +
+ {{ session('success') }} +
+ @endif + @if($errors) + @foreach ($errors->all() as $error) +
{{ $error }}
+ @endforeach + @endif +
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('current-password')) + + {{ $errors->first('current-password') }} + + @endif +
+
+ +
+ + + +
+ + + @if ($errors->has('new-password')) + + {{ $errors->first('new-password') }} + + @endif +
+
+ +
+ + +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 72f7428d..b9bd6e9a 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -64,6 +64,9 @@ + {{-- Log Masuk --}}
diff --git a/routes/web.php b/routes/web.php index cb6c62c8..b060b415 100644 --- a/routes/web.php +++ b/routes/web.php @@ -26,7 +26,20 @@ Route::get('/test', function () { Auth::routes(); Route::get('/home','HomeController@index')->name('home'); +// Route::get('/loginUser','HomeController@index')->name('login'); Route::get('/about','HomeController@about')->name('about'); +Route::get('/editprofile','HomeController@editprofile')->name('editprofile'); +Route::post('/editprofile','HomeController@profileUpdate')->name('profileupdate'); +Route::get('/tukarkatalaluan','HomeController@tukarkatalaluan')->name('tukarkatalaluan'); +Route::get('/changePassword', 'HomeController@showChangePasswordGet')->name('changePasswordGet'); +Route::post('/changePassword', 'HomeController@changePasswordPost')->name('changePasswordPost'); +Route::get('/logout','LogoutController@logout')->name("logout"); + +Route::get('forgot-password', 'UserController@forgotPassword')->name('forgot-password'); +Route::get('forgot-password/{token}', 'UserController@forgotPasswordValidate'); +Route::post('forgot-password', 'UserController@resetPassword')->name('forgot-password'); + +Route::put('reset-password', 'UserController@updatePassword')->name('reset-password'); Route::get('/pembayaran/response','ApiController@response')->name('pay.paymentStatus'); Route::get('/pembayaran/backend','ApiController@callback')->name('pay.callback'); From b71382ab956c82929e06d09d2938160c8606a8d0 Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Sun, 25 Sep 2022 17:27:04 +0800 Subject: [PATCH 2/4] update sikit --- resources/views/includes/header.blade.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/views/includes/header.blade.php b/resources/views/includes/header.blade.php index a3feb404..3a0fdd58 100644 --- a/resources/views/includes/header.blade.php +++ b/resources/views/includes/header.blade.php @@ -35,17 +35,20 @@ {{ __('Tukar Katalaluan') }}
+ {{-- profile --}} {{-- --}} {{-- logout --}} - - {{ __('Logout') }} - +
@csrf From fa8130f1072dec83e128e1748e2cc7deb93e60a1 Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Mon, 26 Sep 2022 09:29:08 +0800 Subject: [PATCH 3/4] update --- resources/views/includes/header.blade.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/resources/views/includes/header.blade.php b/resources/views/includes/header.blade.php index 3a0fdd58..2a03185d 100644 --- a/resources/views/includes/header.blade.php +++ b/resources/views/includes/header.blade.php @@ -28,6 +28,24 @@ {{ __('Profile') }} +<<<<<<< Updated upstream +<<<<<<< Updated upstream +======= +======= + + + - -