i want to combine the data and display it based on the width value of each item, with a table like this how can i do that
my controller
public function test(){
// $item = '20/20/20';
// $dimension = 'width/height/depth';
$item = TestItem::join('t_dimensions','t_items.dimension_id', '=', 't_dimensions.id')->get();
//foreach($item as $item){
//$size = explode('/',$item->size);
//$item = explode('/',$item->dimension);
//}
return response->json($item);
}
table dimensions
| id | dimension |
|---|---|
| 1 | Height/Width |
| 2 | Width/Height/Depth |
table items
| id | item | size | dimension_id |
|---|---|---|---|
| 1 | mistar | 20/5 | 1 |
| 2 | board | 50/100 | 1 |
| 3 | board | 80/50 | 1 |
| 4 | pipe | 120/50/80 | 2 |
| 5 | plate | 200/100 | 1 |
i want to display data like this, only display data that has width >= 100
- board Height 50, Width 100
- pipe Width 100,Height 50, Depth 80
- plate Width 200, Height 100