https://github.com/64robots/products-api-accessor
This package is a command that will generate the access-token for a product-api project.
https://github.com/64robots/products-api-accessor
Last synced: 2 months ago
JSON representation
This package is a command that will generate the access-token for a product-api project.
- Host: GitHub
- URL: https://github.com/64robots/products-api-accessor
- Owner: 64robots
- Created: 2020-01-28T14:39:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-28T17:22:47.000Z (over 6 years ago)
- Last Synced: 2025-02-16T12:29:56.734Z (over 1 year ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A command to generate the access-tokens for a product-api project.
===================================================================
This package is a command that will generate the access-token for a product-api project.
## Installation and setup
To get the latest version, simply require the package using [Composer](https://getcomposer.org):
```bash
$ composer require 64robots/products-api-accessor
```
Once installed, this package will automatically register its service provider.
Publish the config file to `config/products.php` run:
```bash
$ php artisan vendor:publish --provider="R64\ProductsApiAccessor\AccessorServiceProvider" --tag="config"
```
## Usage
- Use passport's command `php artisan passport:client` to generate new Client ID and Client Secret from [Products api](https://gitlab.com/64robots/products-api). Copy the Client ID and Client Secret and set it in your .env like so;
```
PRODUCTS_API_BASE_URI=http://url-to-products-api
PRODUCTS_API_CLIENT_ID=x
PRODUCTS_API_CLIENT_SECRET=xxxx
```
- Ran the command `php artisan generate:products-api-access-token` to generate access token. The token will be automatically set in the .env.