Skip to content

Instantly share code, notes, and snippets.

View vishy-experiments's full-sized avatar
🎧
LoFi

vishy-experiments

🎧
LoFi
View GitHub Profile
@vishy-experiments
vishy-experiments / getAccessToken.php
Last active August 22, 2019 06:22
Laravel Passport Password Grant token request. Uses config's "app.url" to make it environment agnostic.
<? php
/*
|--------------------------------------------------------------------------------
| Environment Agnostinc: Requesting Password Grant Tokens Laravel using Passport
|--------------------------------------------------------------------------------
|
| Ref: https://laravel.com/docs/5.8/passport#requesting-password-grant-tokens
| Set the environment url in .env. Example: http://localhost for local dev server
| Use config('app.url') in the post request
| Makes makes it easy for testing APIs in tools like Postman