My laravel controller
public function index()
{
$get=Storage::disk('public')>get('Philippines.json');
$json = json_decode($get, true);
return view('BarangayFolder.index')>with('json',$json);
the output i'm trying to achieve on my option tag is something like this;
"BANI"
"BUYON"
"CABARUAN"
"CABULALAAN"
"CABUSLIGAN"
"CALIOET-LIBONG"
"CASILIAN"
"COROCOR"
i'cant figure out how to get all the of "barangay_list" data, i tried many solution and ideas but still not getting it.
{
"01": {
"region_name": "REGION 1",
"province_list": {
"ILOCOS NORTE": {
"municipality_list": {
"ADAMS": {
"barangay_list": [
"ADAMS (POB.)"
]
},
"BACARRA": {
"barangay_list": [
"BANI",
"BUYON",
"CABARUAN",
"CABULALAAN",
"CABUSLIGAN",
"CADARATAN"
]
}
}
i managed to get thedata of "region_name" which is "REGION 1" but i can't get the data of barangay_list.
<datalist id="datalist-content">
foreach (array($json['01']) as $data)
<option value="{{$data['region_name']}}"></option>
endforeach
</datalist>