how we push a data to an array in laravel5?

How we push data to the array in laravel5?

push a data to the array:-

if (!empty($request)) {
    $request->all();
    $lan_user_location = $request[0];
    $lat_user_location = $request[1];
    $vehiclelocation = Vehicle::select('veh_last_location')->get()->toArray();
    $location = (json_decode($vehiclelocation[849]['veh_last_location']));

    $rows[] = $location;
    foreach ($rows as $key => $value) {
        $lan_vehicle = $rows[$key][$key]->long;
        $lat_vehicle = $rows[$key][$key]->lati;
    }

    $location = (json_decode($vehiclelocation[851]['veh_last_location']));
    $distance = $this->nearesrtdistance($lat_user_location, $lan_user_location, $lat_vehicle, $lan_vehicle);
    if ($distance < 30) {
        $nearlatlong[] = $lat_vehicle;
        $nearlatlong[] = $lan_vehicle;
        $response = ['status' => 'success', 'nearlatlong' => $nearlatlong, 'statusCode' => Response::HTTP_OK];

        return response()->json(['response' => $response]);
    }
}

Want push lat and long on the $nearlatlong array

Source: AngularJS