|
| 1 | +# PHP Wrapper for Pro6PP Api |
| 2 | + |
| 3 | +[](https://packagist.org/packages/pendonl/laravel-fontawesome) |
| 4 | +[](LICENSE) |
| 5 | +[](https://travis-ci.org/PendoNL/laravel-fontawesome) |
| 6 | +[](https://scrutinizer-ci.com/g/PendoNL/laravel-fontawesome/) |
| 7 | +[](https://insight.sensiolabs.com/projects/e660c560-9d50-43e3-9be1-e556ba78f189) |
| 8 | +[](https://github.com/pendonl/laravel-fontawesome) |
| 9 | + |
| 10 | +The `PendoNL/pro6pp-php-wrapper` package provides an easy to use way to communicate with Pro6PP's API to fetch location based data such as addresses, coordinates, etc. Below you can find a list all methods. |
| 11 | + |
| 12 | +## Installation & Usage |
| 13 | + |
| 14 | +Install the package using composer or by downloading the zip. When downloading the zip you only need to include Pro6pp.php in your page. |
| 15 | + |
| 16 | +`composer require pendonl/pro6pp-php-wrapper` |
| 17 | + |
| 18 | +Below you'll find a page with all methods. Please reference the class and API documentation by Pro6pp for all parameters. |
| 19 | + |
| 20 | +[API Documentation by Pro6pp (Dutch)](https://www.pro6pp.nl/developers/basic-information) |
| 21 | + |
| 22 | +```php |
| 23 | +<?php |
| 24 | + |
| 25 | +require __DIR__ . '/vendor/autoload.php'; |
| 26 | + |
| 27 | +$Pro6pp = new \PendoNL\Pro6pp\Pro6pp('api_code', 'json'); |
| 28 | + |
| 29 | +/** |
| 30 | + * Autocomplete an address. This can be achieved in different ways |
| 31 | + * (1) With a nl_fourpp postalcode |
| 32 | + * (2) With a nl_sixpp postalcode |
| 33 | + * (3) With a nl_sixpp postalcode housenumber and extension |
| 34 | + */ |
| 35 | + |
| 36 | +$Pro6pp->autocomplete(6225); |
| 37 | +$Pro6pp->autocomplete('6225XS'); |
| 38 | +$Pro6pp->autocomplete('6225XS', 7); |
| 39 | +$Pro6pp->autocomplete('6225XS', 7, 'c'); |
| 40 | + |
| 41 | +/** |
| 42 | + * Reverse address look-up. Provide the method with valid lat/lng |
| 43 | + * and you'll be presented with an address if found. |
| 44 | + */ |
| 45 | + |
| 46 | +$Pro6pp->reverse(50.858030, 5.717376); |
| 47 | + |
| 48 | +/** |
| 49 | + * Find the nearest postalcodes from a given set of postalcodes compared |
| 50 | + * to a single postalcode. The second parameter takes an array with either |
| 51 | + * a nl_fourpp, a nl_sixpp or a set of lat/lng. |
| 52 | + */ |
| 53 | + |
| 54 | +$Pro6pp->locator(['6220','6221','6223','6224'], ['nl_fourpp' => 6216]); |
| 55 | + |
| 56 | +/** |
| 57 | + * Find all postals within a given range. The second parameter is in meters. |
| 58 | + */ |
| 59 | + |
| 60 | +$Pro6pp->range(6225, 2500); |
| 61 | + |
| 62 | +/** |
| 63 | + * Get autocomplete suggestions for city names, takes a second parameter for |
| 64 | + * the maximum number of results. |
| 65 | + */ |
| 66 | + |
| 67 | +$Pro6pp->suggest('Maast', 10); |
| 68 | + |
| 69 | +/** |
| 70 | + * Calculate the distance between two nl_fourpp, 3rd parameter can be set to 'road', |
| 71 | + * be carefull: this is for supported account only. |
| 72 | + */ |
| 73 | + |
| 74 | +$Pro6pp->distance(6225, 6210, 'straight'); |
| 75 | + |
| 76 | +/** |
| 77 | + * Calculate distance between two coordinates |
| 78 | + */ |
| 79 | + |
| 80 | +$Pro6pp->coordinate_distance(50.858030, 5.717376, 50.840078, 5.659258); |
| 81 | +``` |
| 82 | + |
| 83 | +## Security |
| 84 | + |
| 85 | +If you discover any security related issues, please email joshua@pendo.nl instead of using the issue tracker. |
| 86 | + |
| 87 | +## Credits |
| 88 | + |
| 89 | +Thanks to Pro6PP for their efforts to create, maintain and update a postal database for a fair price. |
| 90 | + |
| 91 | +## About Pendo |
| 92 | +Pendo is a webdevelopment agency based in Maastricht, Netherlands. If you'd like, you can [visit our website](https://pendo.nl). |
| 93 | + |
| 94 | +## License |
| 95 | + |
| 96 | +The MIT License (MIT). Please see [License File](LICENSE) for more information. |
0 commit comments