Skip to content

Scaffold api authentication for your project using jwt

License

Notifications You must be signed in to change notification settings

lacasera/api-jwt-scaffold

Repository files navigation

Latest Version on Packagist Build Status Quality Score Total Downloads

This package helps you quickly scaffold api authentication for you laravel project using

  1. Laravel Passport
  2. Tymon JWT

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

  1. 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.
  1. 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');
});
  1. Make sure your requests to the api routes add the Accepts: application/json header.

  2. 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.

About

Scaffold api authentication for your project using jwt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages