<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Api\BaseController;

use App\Model\Coverage;

class Controller extends BaseController
{
    public function getCoverageDetail($id)
	{
		$data = array();
        $coverage = Coverage::where('_id',$id)->get();
		if(!empty($coverage)){
			foreach ($coverage as $key => $c) {
				array_push($data, array(
					'city' => $c->city,
                    'state' => $c->state,
                    'postcode' => $c->postcode,
				));
			}
			return $this->sendResponse($data, 'Rekod Ditemui');
		}else{
			return $this->sendError('', 'Rekod Ditemui');
		}
    }
}