使用bootstrap模式更新数据

I'm trying to edit data using the bootstrap modal. I'm passing 3 data with the a href tag. I've managed to send the data to the modal but when clicking update, the result returns null.

Blade

<a href="#" class="text-primary" data-toggle="modal" data-target="#editRoomModal" data-target="editRoomModal"  data-name="{{$data->name}}" data-max="{{$data->max_occupancy}}" data-id="{{$data->id}}"><i class="fas fa-edit fa-fw"></i></a> 

<script>
    $(document).ready(function(){
    $('#editRoomModal').on('show.bs.modal',function(e){
        var link = $(e.relatedTarget),
            modal = $(this),
            id = link.data("id"),
            name = link.data("name"),
            max = link.data("max");

            modal.find('#name').val(name);
            modal.find('#max_occupancy').val(max);
            modal.find('#id').val(id);
        });
});
</script>

Controller

public function editRoom(Request $request)
{
    $room = Room::where('id',$request->roomid)->first();
    dd($room);
}

You are not passing roomid you passing id to controller please use this code i hope it will fix your issue

public function editRoom(Request $request)
{
$room = Room::where('id',$request->id)->first();
dd($room);
}