Package Data | |
---|---|
Maintainer Username: | thibauddt |
Maintainer Contact: | thibaud@d-t.fr (Thibaud DELOBELLE TOUSSAINT) |
Package Create Date: | 2016-12-20 |
Package Last Update: | 2018-11-04 |
Home Page: | |
Language: | PHP |
License: | GPL-3.0 |
Last Refreshed: | 2024-12-22 03:09:03 |
Package Statistics | |
---|---|
Total Downloads: | 104 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 1 |
Total Forks: | 3 |
Total Open Issues: | 2 |
Laravel 5.6 package for authentication based on TrinityCore Database.
TrinityCore authentication is based on a sha1 hash of a concatenation of username and password.
composer require thibaud-dt/trinitycore-auth
Service Provider
'providers' => [
[...]
ThibaudDT\TrinityCoreAuth\Providers\TrinityCoreAuthServiceProvider::class,
[...]
]
Facade
'aliases' => [
[...]
'TrinityCoreAuth' => ThibaudDT\TrinityCoreAuth\Facades\TrinityCore::class,
[...]
]
'connections' => [
[...]
'characters' => [
'driver' => 'mysql',
'host' => env('DB_HOST_CHARACTERS', 'localhost'),
'database' => env('DB_DATABASE_CHARACTERS', 'forge'),
'username' => env('DB_USERNAME_CHARACTERS', 'forge'),
'password' => env('DB_PASSWORD_CHARACTERS', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
'world' => [
'driver' => 'mysql',
'host' => env('DB_HOST_WORLD', 'localhost'),
'database' => env('DB_DATABASE_WORLD', 'forge'),
'username' => env('DB_USERNAME_WORLD', 'forge'),
'password' => env('DB_PASSWORD_WORLD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
'auth' => [
'driver' => 'mysql',
'host' => env('DB_HOST_AUTH', 'localhost'),
'database' => env('DB_DATABASE_AUTH', 'forge'),
'username' => env('DB_USERNAME_AUTH', 'forge'),
'password' => env('DB_PASSWORD_AUTH', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
]
[...]
],
DB_HOST_WORLD=localhost
DB_DATABASE_WORLD=world
DB_USERNAME_WORLD=root
DB_PASSWORD_WORLD=root
DB_HOST_CHARACTERS=localhost
DB_DATABASE_CHARACTERS=characters
DB_USERNAME_CHARACTERS=root
DB_PASSWORD_CHARACTERS=root
DB_HOST_AUTH=localhost
DB_DATABASE_AUTH=auth
DB_USERNAME_AUTH=root
DB_PASSWORD_AUTH=root
php artisan vendor:publish --provider="ThibaudDT\TrinityCoreAuth\Providers\TrinityCoreAuthServiceProvider"
php artisan migrate
It's done ! You can now use the package
| Configuration | Value type | Default value | Description | | :-------------:|:-------------:| :-----:| :-----:| | passport | boolean | false | Active the support of Laravel Passport |
'providers' => [
'users' => [
'driver' => 'trinitycore',
'model' => ThibaudDT\TrinityCoreAuth\Models\Auth\Account::class,
],
],
'passwords' => [
'users' => [
'provider' => 'users',
'connection' => 'auth',
'table' => 'password_resets',
'expire' => 60,
],
],
TrinityCoreAuth::routes();
Yes you can ! Change the configuration value to true and make a refresh of migrations. All accounts created before the activation of the support of Laravel Passport must reset their password to use Password Grant Authorization system.