jeevamugunthan
4 months ago
835
4
Laravel

how to display inner array values in view blade

Posted 4 months ago by jeevamugunthan

i fetched data from database by this code

$count2=count($request['paymento']);
for($i=0;$i<$count2;$i++){
            $data2[]=Otherpayment::get()->where('id','=',$request['paymento'][$i])->toArray();
        }
return view('flatuser.request.view_payment',compact('data2','count2'));

and result of data2 is

Array (

[0] => Array ( [0] => Array ( [id] => 1 [admin_id] => 11 [r_apname] => Hogwards [r_acc_name] => manoj [r_acc_no] => 207487876587658 [r_ifsc_code] => HG00065GH [country_id] => INR [r_mobile] => 8973488181 [c_title] => elevator repairs [c_budget] => 4500 [share_amount] => 4500 [message] => [cut_off_date] => 2020-04-24 [created_at] => 2020-03-24 07:05:00 [updated_at] => 2020-03-24 07:27:35 [status] => 0 [is_primary] => 0 ) )

[1] => Array ( [1] => Array ( [id] => 2 [admin_id] => 11 [r_apname] => Hogwards [r_acc_name] => manoj [r_acc_no] => 207487876587658 [r_ifsc_code] => HG00065GH [country_id] => INR [r_mobile] => 8973488181 [c_title] => painting charges [c_budget] => 3500 [share_amount] => 3500 [message] => [cut_off_date] => 2020-04-24 [created_at] => 2020-03-24 07:34:15 [updated_at] => 2020-03-24 07:34:15 [status] => 0 [is_primary] => 0 ) ) )

and my count result is 2

i want to display this datas in my view blade

my code is

@for($i=0;$i<$count2;$i++)
                <p>{{$data2[$i]['id']}}</p>
            @endfor

any body know this

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