Download the PHP package iamnotstatic/laravel-api-auth without Composer
On this page you can find all versions of the php package iamnotstatic/laravel-api-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iamnotstatic/laravel-api-auth
More information about iamnotstatic/laravel-api-auth
Files in iamnotstatic/laravel-api-auth
Package laravel-api-auth
Short Description A Laravel Package for easy API authentication setup with passport
License MIT
Rated 5.00 based on 1 reviews
Informations about the package laravel-api-auth
Laravel API Auth
Introduction
A Laravel Package for easy API authentication setup with passport
Installation
To get the latest version of Laravel Api Auth, simply require it
Configuration
You can publish the configuration file using this command:
Migrate your database after installing the package
This command will create the encryption keys needed to generate secure access tokens. In addition, the command will create "personal access" and "password grant" clients which will be used to generate access tokens
Next, you should call the Passport::routes method within the boot method of your AuthServiceProvider. This method will register the routes necessary to issue access tokens and revoke access tokens, clients, and personal access tokens:
In your config/auth.php configuration file, you should set the driver option of the api authentication guard to passport. This will instruct your application to use Passport's TokenGuard when authenticating incoming API requests:
In your config/auth.php configuration file, you should set the model option of the package model. This will provide a few helper methods to allow you to inspect the authenticated user's token and scopes:
Usage
Now, we can simple test by rest client tools (Postman), So I test it and you can see below screenshots.
In this api you have to set two header as listed below:
Register
Login
Logout
Get User
Forgotten Password
Reset Passowrd
Contributing
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
How can I thank you?
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!
Don't forget to follow me on twitter!
Thanks! Abdulfatai Suleiman.
License
The MIT License (MIT). Please see License File for more information.