How to convert array members to int. My controller code
public function show()
{
$i = DB::table('users')->lists('id');
// var_dump($i);
return View::make('seat.seatselect')->with('i', $i);
}
When I var_dump($i) it result is as following
array(12) { [0]=> int(5) [1]=> int(14) [2]=> int(16) [3]=> int(17) [4]=> int(18) [5]=> int(19) [6]=> int(20) [7]=> int(21) [8]=> int(22) [9]=> int(23) [10]=> int(24) [11]=> int(26) }
So in my view I call $i. Resu is coming only last value of $i
@foreach($i as $i)
var bookedSeats = [{{$i}}];
@endforeach
But I want to retrieve the result as followed Example:
var bookedSeats = [1, 2, 3, 4, 5, 6, 7, 9, 13, 56];
How to solve it. Help me please.