PHP code example of mobieve / auth-client

1. Go to this page and download the library: Download mobieve/auth-client 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/ */

    

mobieve / auth-client example snippets


    'providers' => [
        ...
        Mobieve\AuthClient\Providers\CustomClientServiceProvider::class

    ],
  

    'aliases' => [
        ...
        'JWTFactory' => Tymon\JWTAuth\Facades\JWTFactory::class,
        'JWTAuth' => Tymon\JWTAuth\Facades\JWTAuth::class,
        'MobieveClient' => Mobieve\AuthClient\Facades\CustomClient::class
    ],
  

    'aliases' => [
        ...
        'Auth' => Illuminate\Support\Facades\Auth::class,
        'User' => App\User::class,
        'Team' => App\Team::class
    ],
  

    return [
      ...
      'auth' => [
          'url' => env('MOBIEVE_AUTH_URL') . '/oauth/token',
          'client_id' => env('MOBIEVE_AUTH_CLIENT_ID'),
          'client_secret' => env('MOBIEVE_AUTH_CLIENT_SECRET')
      ]
    ];
  

    MobieveClient::get(string $url, array $params);
    MobieveClient::post(string $url, array $params);
    MobieveClient::put(string $url, array $params);
    MobieveClient::delete(string $url);
  

    protected $routeMiddleware = [
      ...
      'mobieve.auth-client' => \Mobieve\AuthClient\Middleware\MovieveClientAuthMiddleware::class,
      'mobieve.auth-user' => \Mobieve\AuthClient\Middleware\MovieveClientAuthMiddleware::class
    ];