Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
add update profile
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina committed May 13, 2022
1 parent 87119e1 commit 43fa254
Show file tree
Hide file tree
Showing 8 changed files with 396 additions and 272 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/RentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function findVehicles() {

public function getFindMotor()
{
return view('find-vehicles');
return view('find-vehicles', ['type' => 'Motor']);
}

public function getRentCarForm()
Expand All @@ -49,11 +49,11 @@ public function getRentMotorForm()

public function getRentCars()
{
return view('vehicles-list', ['vehicles' => session('vehicles'), 'type' => 'Car']);
return view('vehicles-list', ['vehicles' => session('vehicles'), 'type' => 'car']);
}

public function getRentMotors()
{
return view('vehicles-list');
return view('vehicles-list', ['vehicles' => session('vehicles'), 'type' => 'motor']);
}
}
15 changes: 15 additions & 0 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,19 @@ public function getUserOrders()
{
return view('order-history');
}

public function updateProfile()
{
$request = request()->input();

$user = auth()->user();

$user->phone_1 = $request['phone_1'];
$user->phone_2 = $request['phone_2'];
$user->address_id = $request['address_id'];
$user->address_mlg = $request['address_mlg'];
$user->save();

return redirect()->route('index');
}
}
Loading

0 comments on commit 43fa254

Please sign in to comment.