yes dd() it gives me always room5 ? the request always room5 inside the "A Hotel"
the problem is in every hotel click the room give me the last hotel for all.
here is extra code
parent Blade
<div class="action">
<a href="{{route('singleRoom.show', [$room->slug, $room->id])}}" class="btn btn-info">View Detail</a>
<button type="button" class="btn btn-default" style="background-color:#ff9f1a; color: black" data-toggle="modal" data-target="#reserveForm">
Book Now<br> <span style="color: green; font-weight: bold;">5%-10% Off</span>
</button>
</div>
<!-- Modal Confrence-->
<div class="modal fade" id="reserveForm" tabindex="-1" role="dialog" aria-labelledby="reservationForm" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="reservationForm">Get Rest Booking Service</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
@include('SelfBook.general')
</div>
</div>
</div>
</div>
selfBook.general blade
@if ($room->quantity > 0)
<form action="{{ route('selfBook.store', $room) }}" method="POST">
{{ csrf_field() }}
<button type="submit" class="button button-plain">Pay Later <br> <span>Valid Only for 20 Min</span></button>
</form>
@endif
web
Route::get('/room/{slug}/{id}', 'SingleRoomController@show')->name('singleRoom.show');
Route::get('/conference/{slug}/{id}', 'SingleConferenceController@show')->name('singleConference.show');
//self Room
Route::get('/selfBook', 'SelfBookController@index')->name('selfBook.index');
Route::post('/selfBook/{room}', 'SelfBookController@store')->name('selfBook.store');
Route::patch('/selfBook/{room}', 'SelfBookController@update')->name('selfBook.update');
Route::delete('/selfBook/{room}', 'SelfBookController@destroy')->name('selfBook.destroy');
public function store( Room $room)
{
dd($room);
if(Auth::check())
{
$roomPrice=$room->room_price;
$check_in=CarbonImmutable::now();
$check_out=$check_in->add(1, 'day');
$user_id=Auth::user()->id;
.
.
...
}
any help:)