PHPackages                             stratedge/visa - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. stratedge/visa

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

stratedge/visa
==============

A complimentary extension of the official Laravel Passport package.

v7.0.0(7y ago)311MITPHP

Since Dec 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/stratedge/visa)[ Packagist](https://packagist.org/packages/stratedge/visa)[ RSS](/packages/stratedge-visa/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

[![Build Status](https://camo.githubusercontent.com/95f4651ff1a7469516aacc687ce99c3ea29d291fb84ee9da89db8eded576bfe2/68747470733a2f2f7472617669732d63692e6f72672f7374726174656467652f766973612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/stratedge/visa)[![Latest Stable Version](https://camo.githubusercontent.com/c8d3d7757ad3b32aa10b116f95781421d3d48fc4e567a945415973c42f68719e/68747470733a2f2f706f7365722e707567782e6f72672f7374726174656467652f766973612f762f737461626c65)](https://packagist.org/packages/stratedge/visa)[![Total Downloads](https://camo.githubusercontent.com/3052d3d75c893f993517f2639e99e96db8c2209227749fae498d575d5f77191f/68747470733a2f2f706f7365722e707567782e6f72672f7374726174656467652f766973612f646f776e6c6f616473)](https://packagist.org/packages/stratedge/visa)[![License](https://camo.githubusercontent.com/f3a4d9b5565b11b5434354272efa268649f492739b6c48048dc70d1b66445578/68747470733a2f2f706f7365722e707567782e6f72672f7374726174656467652f766973612f6c6963656e7365)](https://packagist.org/packages/stratedge/visa)

Visa
====

[](#visa)

A complimentary extension of the official Laravel Passport package.

Visa provides the following functionality:

- Use a random string for Client ID;
- Add configuration to use a UUID for Client ID instead of a random string;
- Provide the `CheckFirstPartyClient` middleware class to authenticate a client as a first party client;
- Add configuration to use the global Laravel error handler to handle errors thrown by Passport instead of Passport's built-in handler; and
- Provide overwrite-able `enableCustomGrants()` method in the service provider to make registering custom grants easier.

Passport Compatability
======================

[](#passport-compatability)

While this library mostly adheres to semantic versioning, major version numbers are set to align to major versions for the Passport library. This simplifies determining which version of Visa includes which version of Passport.

Visa VersionConfigured Passport Version7.\*^7.0Installation
============

[](#installation)

Visa is registered with [Packagist](https://packagist.org) and can be installed with [Composer](https://getcomposer.org). Run the following on the command line:

```
composer require stratedge/visa
```

Since Visa *extends* Passport, installing Visa will install Passport for you.

For versions of Laravel that support auto-registration of packages, Visa will automatically register itself. For older versions, be sure to add `Stratedge\Visa\VisaServiceProvider::class` to your list of service providers in `config/app.php`.

> No need to include Passport's service provider, the Visa provider extends it.

From here, complete all the typical [Passport installation steps](https://laravel.com/docs/master/passport#installation).

> **PLEASE NOTE:** See configuration below to ensure you complete any optional Visa configurations before running migrations to ensure columns are created with the correct types.

Configuration
=============

[](#configuration)

To configure core Passport features, refer to the [Passport documentation](https://laravel.com/docs/master/passport). Since Visa uses Passport, you're free to configure whatever you want from Passport.

Using Random Strings for Client ID
----------------------------------

[](#using-random-strings-for-client-id)

By default Visa will use random 40-character strings for client IDs, the same as the client secrets. No configuration required.

Using UUIDs for Client ID
-------------------------

[](#using-uuids-for-client-id)

Visa also supports UUIDs for client IDs, but must be configured to do so *before migrations are run* so that the migrations specify the correct column type for `client_id`.

To use UUIDs, call `\Stratedge\Visa\Visa::enableClientUUIDs()` in the `boot()` method of your `AppServiceProvider`:

```
