devtvn/sociallumen

v1.1 2023-07-17 02:32 UTC

This package is auto-updated.

Last update: 2024-04-22 09:58:13 UTC


README

68747470733a2f2f692e706f7374696d672e63632f74547373533334572f7061636b6167652d636f72652e706e67

Social authentication multiple-platform and management users

feature

  • Facebook
  • Google
  • Tiktok(maintenance)
  • Instagram
  • Twitter
  • Github
  • Linkedin
  • Bitbucket
  • GitLab
  • Microsoft
  • Dropbox
  • Reddit
  • Pinterest(maintenance)
  • Line
  • shopify

Official Core SDKs

Required

  • Php >= 8.x
  • Lumen >= 8.x
  • Composer >= 2.x

Install

composer require devtvn/sociallumen

Setup

  • Add the config behind in the file bootstrap/app.php
$app->routeMiddleware([
    "api"=> \Devtvn\Social\Http\Middleware\GlobalJwtMiddleware::class,
]);
$app->register(Illuminate\Redis\RedisServiceProvider::class);
$app->register(\Devtvn\Sociallumen\CoreServiceProvider::class);
$app->configure('database');
$app->configure('social');
$app->withFacades();
$app->withEloquent();
  • Add the config behind in the file config database.php
 <?php
  'connections' => [
    ...
     'database_core' => [
                'driver' => 'pgsql',
                'url' => env('DATABASE_CORE_URL'),
                'host' => env('DB_CORE_HOST', 'postgres'),
                'port' => env('DB_CORE_PORT', '5432'),
                'database' => env('DB_CORE_DATABASE', 'core'),
                'username' => env('DB_CORE_USERNAME', 'default'),
                'password' => env('DB_CORE_PASSWORD', 'secret'),
                'charset' => 'utf8',
                'prefix' => '',
                'prefix_indexes' => true,
                'schema' => 'public',
                'sslmode' => 'prefer',
    
            ],
    ...
]
  • If you want customs model core then add config behind
use Devtvn\Social\Models\Core;
class User extends Core
{  
}

After setup config completed :

  • Run command in terminal:
php artisan vendor:publish --tag=core-social && php artisan migrate
  • Setup worker:
php artisan queue:work {onconnection in file social.php} --queue={onqueue in file social.php} --sleep=3 --tries=3 --timeout=9000
  • Setup redirect_uri in app developer :
  {host}/api/handle/auth 

API

Method URI Action Middleware
POST api/{platform}/generate-url CoreController@generateUrl global
GET api/handle/auth CoreController@handleAuth social.auth,core.shopify,global
POST api/app/login AppController@login global
POST api/app/register CoreController@register global
POST api/app/refresh CoreController@refresh refresh
DELETE api/app/delete CoreController@delete core ,global
GET api/app/info CoreController@user core ,global
POST api/app/info CoreController@updateUser core ,global
PUT api/app/change-password CoreController@changePassword core ,global
POST api/app/forgot-password CoreController@reset global
POST api/app/re-send CoreController@reSendLinkEmail global

MIT