git add .
git commit "Implement authentication flow and initialize home page hero section"
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\ProfileUpdateRequest;
|
||||
use App\Models\Province;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -14,7 +15,9 @@ class ProfileController extends Controller
|
||||
{
|
||||
$withoutHero=true;
|
||||
$user=Auth::User();
|
||||
return view('users.profile.edit',compact('user','withoutHero'));
|
||||
$provinces=Province::orderBy('name')->get();
|
||||
|
||||
return view('account.users.profile.edit',compact('user','withoutHero','provinces'));
|
||||
}
|
||||
|
||||
public function update(ProfileUpdateRequest $request)
|
||||
@@ -22,9 +25,9 @@ class ProfileController extends Controller
|
||||
$user=$request->user();
|
||||
$inputs=$request->validated();
|
||||
|
||||
if (!empty($inputs['new_password'])){
|
||||
$user->password=Hash::make($inputs['new_password']);
|
||||
}
|
||||
if ($request->filled('new_password')){
|
||||
$inputs['password']=Hash::make($request->new_password);
|
||||
}
|
||||
|
||||
unset(
|
||||
$inputs['current_password'],
|
||||
@@ -46,6 +49,7 @@ class ProfileController extends Controller
|
||||
|
||||
$inputs['profile_image'] = $imageName;
|
||||
}
|
||||
|
||||
$user->update($inputs);
|
||||
|
||||
return back()->with([
|
||||
|
||||
Reference in New Issue
Block a user