yabhq / flightdeck
API boilerplate for Laravel
Requires
- php: ^8.2
- illuminate/support: ^11.0
- tymon/jwt-auth: ^2.1
Requires (Dev)
- laravel/legacy-factories: ^1.4
- orchestra/testbench: ^9.4
- phpunit/phpunit: ^11.0
README
Installation
You can install the package via composer:
composer require yabhq/flightdeck
Usage
Generate new API key for authorization
php artisan flightdeck:generate app1
List all available API keys
php artisan flightdeck:list
Multi-Auth
FlightDeck makes authenticating users with multiple guards a breeze.
Suppose you wish to add support for login, logout and token refreshing for a hypothetical "customer" user type.
Simply extend the FlightDeck AuthController
class as follows:
<?php namespace App\Http\Controllers\Customer; use Yab\FlightDeck\Http\Controllers\AuthController as FlightAuthController; class AuthController extends FlightAuthController { /** * Get the guard to be used for login, logout and token refreshes. * * @return \Illuminate\Contracts\Auth\StatefulGuard */ protected function guard() { return auth()->guard('customer'); } }
You can also extend FlightDeckForgotPasswordController
and FlightDeckResetPasswordController
in a similar way.
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 us instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.