PATH:
home
/
lab2454c
/
internationalminersbank.com
/
backup
/
app
/
Http
/
Controllers
/
Admin
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Validation\ValidationException; class PasswordController extends Controller { public function __construct() { $this->middleware('auth:admin'); } public function showChangePassword() { return view('admin.auth.changePassword'); } public function changePassword(Request $request) { $value = $request->validate([ 'current' => ['required', 'string', function ($attribute, $value, $fail) { if (!Hash::check($value, Auth::user()->password)) { return $fail(__('The current password is incorrect.')); } }], 'password' => 'required|string|confirmed|min:4|max:20|different:current', ]); if(Auth::guard()->attempt(['name'=>Auth::user()->name, 'password' => $value['current']])){ $user = Auth::user(); $user->password = Hash::make($value['password']); $user->save(); toast('Your password has been successfully changed!','success'); return redirect()->route('adminHome'); } throw ValidationException::withMessages([ 'current' => [trans('auth.failed')], ]); } }
[-] HomeBannerController.php
[edit]
[-] EventController.php
[edit]
[-] CategoryController.php
[edit]
[-] PasswordController.php
[edit]
[-] CareerController.php
[edit]
[-] CareerContentController.php
[edit]
[+]
..
[-] EventContentController.php
[edit]
[-] SiteSettingController.php
[edit]
[-] ServiceController.php
[edit]
[-] PageController.php
[edit]
[-] TestimonialController.php
[edit]
[-] HomeTitleController.php
[edit]
[-] SocialLinkController.php
[edit]
[-] FeaturedProductController.php
[edit]
[-] ExploreController.php
[edit]
[-] MinerPageController.php
[edit]
[-] AdminUserController.php
[edit]
[-] LeadershipController.php
[edit]
[-] FaqController.php
[edit]
[-] CommodityTraderPageController.php
[edit]
[-] GalleryController.php
[edit]
[-] LoginController.php
[edit]
[-] MinerContentController.php
[edit]
[-] TraderBannerLinkController.php
[edit]
[-] DashboardController.php
[edit]
[-] MinerBannerLinkController.php
[edit]
[-] CommodityTraderContentController.php
[edit]