An uncaught Exception was encountered Type: TypeError Message: Cannot access offset of type string on string

controller code

 public function edit($increment_name) {
        $this->load->model("RequestModel");
     
        $request_data['request'] = $this->RequestModel->editRequest($increment_name);
        
        // Debug the contents of $request_data['request']
        //var_dump($request_data);
        $this->load->view('components/layout');
        $this->load->view('client/edit', $request_data);
       
       
    }

Model code

 public function editRequest($increment_name) {
        $request_query = $this->db->get_where('tblrequest', ['increment_name' => $increment_name]);
    
        $request_data = $request_query->row_array();
        return $request_data;
    }

view code

<?php foreach ($request as $item): ?>
            <li class="list-group-item d-flex justify-content-between" style="margin-top: 20px;">
                <input type="text" class="inputstylenum" name="item_name[]" value="<?= $item['item_name'] ?>" placeholder="Item name" required>
                <input type="number" name="stock_quantity[]" value="<?= $request['stock_quantity']; ?>>" class="inputstylenum" required>
                <input type="number" name="available_quantity[]" value="<?php echo $item['available_quantity']; ?>" class="inputstylenum" required>
                <button type="button" class="remove-btn btn btn-danger">Remove</button>
            </li>
        <?php endforeach; ?>

I want to show the data there are multiple products with the same increment_name. I want to show all items using this loop. am using the CodeIgniter framework.