public function get(Request $request) { $zip = $request->get('zip', '0'); if ($zip !== '0' && mb_strlen($zip) === 8 && preg_match("/^[0-9]{8}?\$/", $zip)) { $zipcodeinfo = zipcode($zip); if ($zipcodeinfo) { return $zipcodeinfo->getJson(); } } return Response::json(['error' => 1]); }
/** * Test Helper */ public function testHelperToZipCodeInfoInstance() { $this->assertInstanceOf('Canducci\\ZipCode\\Contracts\\ZipCodeInfoContract', zipcode('01414000')); }
/** * Traits ZipCode * * @param string $value * @param bool $renew * @return Canducci\ZipCode\ZipCodeInfo * @throws Canducci\ZipCode\ZipCodeException */ public function zipcode($value, $renew = false) { return zipcode($value, $renew); }
title : "Property Details", url : "<?php the_permalink(); ?> ", idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM, activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM } new GSmapSearchControl( document.getElementById("mapsearch"), "<?php the_title(); ?> , <?php city(); ?> , <?php state(); ?> , <?php zipcode(); ?> ", options ); } GSearch.setOnLoadCallback(LoadMapSearchControl); </script> <div id="location" class="right"> <div id="mapsearch">Loading...</div> </div>