Aronaman
2 months ago
325
7
Laravel

fetching Wrong Data

Posted 2 months ago by Aronaman

web.php

//self reservation
Route::post('/selfBook/{room}', '[email protected]')->name('selfBook.store');
Route::get('/selfBook/{room}', '[email protected]')->name('selfBook.create');// i pass room in create method b/c i use values of room while create new booking

blade file

 @if ($room->quantity > 0)
                <form action="{{ route('selfBook.create', $room) }}" method="GET">
                    {{ csrf_field() }}
                    <button type="submit" class="button button-plain">Pay Later <br> <span>Valid Only for 20 Min</span></button>
                </form>
            @endif

selfBook Controller

 public function create(Room $room)
    {
       dd($room);
....
}

my problem is fetching the last data in all children! when i click to single room type it shows me, master, if i click on the double it shows me, master. fetching only the master(last children).

Please sign in or create an account to participate in this conversation.