lacasera / api-jwt-scaffold
scaffold jwt authentication for your api
dev-master
2019-10-06 23:01 UTC
Requires
- php: ^7.1
Requires (Dev)
- mockery/mockery: dev-master
- orchestra/testbench: ~3.6.0
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-04-07 09:21:27 UTC
README
This package helps you quickly scaffold api authentication for you laravel project using
Installation
NB: always install this package on a fresh install of laravel since it will overwrite some existing files
You can install the package via composer:
composer require lacasera/api-jwt-scaffold --dev
Usage
- run the command
php artisan make:auth-api
An Auth and Register Controllers will be generated under the Auth namespace to handle authentication requests to your application.
Feel free to modify them to your applications needs.
- define your routes
//api.php Route::group(['namespace' => 'Auth'], function(){ Route::get('me', 'AuthController@me'); Route::post('login', 'AuthController@login'); Route::get('logout', 'AuthController@logout'); Route::post('register', 'RegisterController@create'); });
-
Make sure your requests to the api routes add the
Accepts: application/json
header. -
Enjoy.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email aboateng62@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.