PHP code example of fast-api / permission
1. Go to this page and download the library: Download fast-api/permission library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fast-api / permission example snippets
// Authentication Defaults
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
]
// Authentication Guards
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'jwt',
'provider' => 'users',
'hash' => false,
],
]
// User Providers
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \Fast\Api\Permission\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
]
'default' => [
'length' => 4,
'width' => 150,
'height' => 47,
'quality' => 50,
'math' => false,
'expire' => 60,
'encrypt' => false,
]
/*
* Absolute paths to directory containing the swagger annotations are stored.
*/
'annotations' => [
base_path('app'),
base_path('vendor/fast-api'),
]
ini
APP_URL=http://localhost:8000
ini
API_PREFIX=api
sh
php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"
sh
php artisan jwt:secret
sh
php artisan vendor:publish --provider="Mews\Captcha\CaptchaServiceProvider"
sh
php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider"
ini
L5_SWAGGER_GENERATE_ALWAYS=true
L5_SWAGGER_CONST_HOST=http://127.0.0.1:8000
sh
php artisan migrate --path=vendor/fast-api/permission/database/migrations
sh
php artisan db:seed --class=AdminUserSeeder
sh
php artisan serve