Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add redirect route to detail room #23

Merged
merged 3 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/Http/Controllers/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ public function create()
*/
public function store(StoreRoomRequest $request)
{
//

}

/**
* Display the specified resource.
*/
public function show(Room $room)
{
//
// redirect to detail-ruangan view
// return view('user.detail-ruangan', compact('room'));
}

/**
Expand Down
17 changes: 9 additions & 8 deletions app/View/Components/Dashboard/CardRoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ class CardRoom extends Component
* Create a new component instance.
*/
public $id;

public $name;
public $code;
public $capacity;
public $floor;
public $image;
public $status;
public function __construct($name, $code, $capacity, $floor, $image, $status, $id)
public $name;
public $code;
public $capacity;
public $floor;
public $image;
public $status;
public $room;
public function __construct($name, $code, $capacity, $floor, $image, $status, $id, $room)
{
$this->name = $name;
$this->code = $code;
Expand All @@ -28,6 +28,7 @@ public function __construct($name, $code, $capacity, $floor, $image, $status, $i
$this->image = $image;
$this->status = $status;
$this->id = $id;
$this->room = $room;
}

/**
Expand Down
26 changes: 26 additions & 0 deletions resources/views/user/detail-ruangan.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
</head>
<body>
{{--
$table->string('code');
$table->string('name');
$table->integer('floor');
$table->string('image');
$table->integer('capacity');
--}}

<ul>
<li>{{ $room->name }}</li>
<li>{{ $room->code }}</li>
<li>{{ $room->floor }}</li>
<li>{{ $room->image }}</li>
<li>{{ $room->capacity }}</li>
</ul>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="bookBtn text-white bg-gray-800 hover:bg-gray-900 font-medium rounded-lg t
Booking Ruangan
</button>
@endif
<a href="{{ $code }}"
<a href="{{ route('room.show', $room) }}"
class="text-gray-900 hover:text-white border border-gray-600 hover:bg-gray-600 font-medium rounded-lg text-sm px-5 py-2.5 text-center no-underline">
Lihat Detail Ruangan
</a>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/user/ruangan.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class="text-white bg-gray-800 hover:bg-gray-900 font-medium rounded-lg text-sm p
<div class="grid grid-cols-4 gap-4">
@foreach ($rooms as $room)
<x-dashboard.card-room status="kosong" :name="$room->name" :image="$room->image" :capacity="$room->capacity"
:code="$room->code" :floor="$room->floor" :id="$room->id" />
:code="$room->code" :floor="$room->floor" :id="$room->id" :room="$room" />
@endforeach
</div>
</section>
Expand Down