avinmaster/laravel-jwt-api

A Laravel JWT API starter project template.

1.0.1 2022-01-07 11:11 UTC

This package is auto-updated.

Last update: 2024-04-16 16:25:52 UTC


README

Build Status Total Downloads Latest Stable Version

A Laravel JWT API starter kit.

Features

  • Laravel 8
  • Login, register, email verification and password reset
  • Authentication with JWT
  • Socialite integration

Installation

  • composer create-project --prefer-dist avinmaster/laravel-jwt-api
  • Edit .env and set your database connection details
  • (When installed via git clone or download, run php artisan key:generate and php artisan jwt:secret)
  • php artisan migrate
  • npm install

Usage

Socialite

This project comes with GitHub as an example for Laravel Socialite.

To enable the provider create a new GitHub application and use https://example.com/api/oauth/github/callback as the Authorization callback URL.

Edit .env and set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET with the keys form your GitHub application.

For other providers you may need to set the appropriate keys in config/services.php and redirect url in OAuthController.php.

Email Verification

To enable email verification make sure that your App\User model implements the Illuminate\Contracts\Auth\MustVerifyEmail contract.

Testing

Run all unit and feature tests

vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information what has changed recently.