block sag

This commit is contained in:
Afiq
2022-02-27 23:59:16 +08:00
parent 04716a2a45
commit 955328c35e
46 changed files with 1567 additions and 1562 deletions
@@ -1,14 +1,14 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Rules\MatchOldPassword;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Http;
use App\User;
class ChangePasswordController extends Controller
{
/**
@@ -20,7 +20,7 @@ class ChangePasswordController extends Controller
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
@@ -29,10 +29,10 @@ class ChangePasswordController extends Controller
public function index()
{
$auth_user = Auth::user();
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('user.update_password',compact('cawangan_info'));
}
}
/**
* Show the application dashboard.
*
@@ -45,9 +45,9 @@ class ChangePasswordController extends Controller
'new_password' => ['required'],
'new_confirm_password' => ['same:new_password'],
]);
User::find(auth()->user()->id)->update(['password'=> Hash::make($request->new_password)]);
return redirect()->route('profile');
}
}
}