{"id":15067126,"url":"https://github.com/webreinvent/laravel-usps","last_synced_at":"2025-07-13T09:31:49.143Z","repository":{"id":57079086,"uuid":"270960866","full_name":"webreinvent/laravel-usps","owner":"webreinvent","description":"USPS API wrapper for Laravel projects.","archived":false,"fork":false,"pushed_at":"2023-06-30T06:10:05.000Z","size":767,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-28T14:06:29.172Z","etag":null,"topics":["laravel","laravel-7","laravel-7-package","laravel-framework","usps-packages"],"latest_commit_sha":null,"homepage":"https://webreinvent.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webreinvent.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-09T09:34:55.000Z","updated_at":"2024-05-12T13:59:55.000Z","dependencies_parsed_at":"2024-11-15T08:03:58.452Z","dependency_job_id":"e8c07b7e-8869-4f59-b901-17ee81fc192d","html_url":"https://github.com/webreinvent/laravel-usps","commit_stats":{"total_commits":43,"total_committers":4,"mean_commits":10.75,"dds":0.2093023255813954,"last_synced_commit":"de4a4f95527b892b1b3065673b9d2267e872cc39"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/webreinvent/laravel-usps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webreinvent%2Flaravel-usps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webreinvent%2Flaravel-usps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webreinvent%2Flaravel-usps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webreinvent%2Flaravel-usps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webreinvent","download_url":"https://codeload.github.com/webreinvent/laravel-usps/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webreinvent%2Flaravel-usps/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262613871,"owners_count":23337262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-7","laravel-7-package","laravel-framework","usps-packages"],"created_at":"2024-09-25T01:17:02.776Z","updated_at":"2025-07-13T09:31:48.873Z","avatar_url":"https://github.com/webreinvent.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel-Usps\n\nThis package provides a very simple wrapper for the United States Postal Service API. Currently, this package only provides address validation features, but will soon comprise all features offered by the USPS API.\n\n### Prerequisites\n\nBe sure to register at [www.usps.com/webtools/](www.usps.com/webtools/) to receive your unique user ID\nfrom the United States Postal Service. This user ID is required to use this package.\n\n### Installation\n\n```\ncomposer require webreinvent/laravel-usps\n```\n\n## Configuration\n\nThere are three important configurations.\n1. Your USPS user ID:\n    - If you have not received your USPS user ID, follow the link in the [prerequisites](#Prerequisites) section  to register with the \n      United States Postal Service. It is required to use this package.\n\n2. Whether you want SSL verification enabled for API requests:\n    - This setting is set to `true` by default for security reasons. You can override this behavior by setting the `verrifyssl` config     setting to `false`.   Do this at your own risk.\n\n3. Which environment you are working in:\n\t- The options are `'local' and 'production'` which tell the package which API url to use, testing or production respectively. If no configuration is found     for `env`, it will default to the environment recognized by laravel. This setting takes precedence over `APP_ENV` from your `.env` file.\n\nWe recommend placing all configuration settings in your `.env` file and use Laravel's `env()` helper function to access these values.\n\nIn `config/services.php` add these three settings.\n\n```php\n'usps' =\u003e [\n\n    'userid' =\u003e env('USPS_USER_ID'), // string\n    'verifyssl' =\u003e env('USPS_VERIFY_SSL'), // bool\n    'env' =\u003e env('USPS_ENV') //string\n];\n```\n\n## Usage\n\nThe current features offered by this package are:\n - [Address Validation](#Address-Validation) \n\n\n## Address Validation\n\nThe `Address` class handles creating and formatting address data. Pass the constructor an associative array of address details. Array keys are case-sensitive.\nBelow is an example of creating an address and making an api request for validation.\n\n```php\nuse WebReinvent\\Usps\\Address;\n\n$address = new Address([\n    'Address2' =\u003e '6406 Ivy Lane',\n    'City' =\u003e 'Greenbelt',\n    'State' =\u003e 'MD',\n    'Zip5' =\u003e 20770\n]);\n\n$response = $address-\u003evalidate();\n```\nThe USPS api supports up to 5 address validations per request. If you need to validate more than one address at a time, pass an array of addresses to the `Address` constructor.\n\n```php\nuse WebReinvent\\Usps\\Address;\n\n$address1 = [\n    'Address2' =\u003e '6406 Ivy Lane',\n    'City' =\u003e 'Greenbelt',\n    'State' =\u003e 'MD',\n    'Zip5' =\u003e 20770\n];\n\n$address2 = [\n    'Address2' =\u003e '2185 Sandy Drive',\n    'City' =\u003e 'Franklin',\n    'State' =\u003e 'VA',\n    'Zip5' =\u003e 32050\n];\n\n$addresses = new Address([$address1, $address2]);\n\n$response = $addresses-\u003evalidate();\n```\n\nThe response will contain the [corrected address](https://www.usps.com/business/web-tools-apis/address-information-api.pdf), or an error if not enough information was given or the address does not exists.\n\n## Response Formatting\n\nYou can specify the format of the response by passing an optional, case-insensitive parameter to the validate method. The default format is an associative array.\n\n```php\n$address = new Address([/* address info */ ]);\n\n$json = $address-\u003evalidate('json');\n$object = $address-\u003evalidate('object');\n$string = $address-\u003evalidate('string');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreinvent%2Flaravel-usps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreinvent%2Flaravel-usps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreinvent%2Flaravel-usps/lists"}