PHPackages                             mutahir-shah/uspslaravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mutahir-shah/uspslaravel

ActiveLibrary

mutahir-shah/uspslaravel
========================

This version is a modified version of https://github.com/johnpaulmedina/laravel-usps

051PHP

Since Feb 7Pushed 8y agoCompare

[ Source](https://github.com/mutahir-shah/uspslaravel)[ Packagist](https://packagist.org/packages/mutahir-shah/uspslaravel)[ RSS](/packages/mutahir-shah-uspslaravel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Laravel-USPS
============

[](#laravel-usps)

Updated version of below package. Updates are done by . Laravel-USPS updated package of .

Laravel-USPS is a composer package that allows you to integrate the USPS Address / Shipping API. This backage is ported from @author Vincent Gabriel

- Requires a valid USPS API Username
- Tested on Laravel 5+

Installation
------------

[](#installation)

Begin by installing this package through Composer. Run this command from the Terminal:

```
composer require mutahir-shah/uspslaravel:dev-master
```

Laravel integration
-------------------

[](#laravel-integration)

To wire this up in your Laravel project you need to add the service provider. Open `config/app.php`, and add a new item to the providers array.

```
'Usps\UspsServiceProvider',
```

Then you must also specify the alias in `config/app.php`. Add a new item to the Aliases array.

```
'Usps' => 'Usps\Facades\Usps',
```

This will allow integration by adding the Facade `Use Usps;`

Laravel Config
--------------

[](#laravel-config)

Add your USPS username config in `config/services.php`.

```
'usps' => [
		'username' => "XXXXXXXXXXXX"
	]
```

Example Controller Usage
------------------------

[](#example-controller-usage)

The only method completed for Laravel is the `Usps::validate`,getPriorityLabels,calculateRates which is defined in `vendor/johnpaulmedina/laravel-usps/src/Usps/Usps.php`. I am adding more methods in it. I suggest looking at the original PHP-Wrapper by @VinceG [USPS PHP-Api](https://github.com/VinceG/USPS-php-api "USPS PHP-Api by VinceG") as I ported those clases and autoloaded them to use in the `Usps.php` file.

```
