PHP code example of wemx / sso-pterodactyl

1. Go to this page and download the library: Download wemx/sso-pterodactyl 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/ */

    

wemx / sso-pterodactyl example snippets


public function loginPanel()
{
    $response = Http::get("https://panel.example.com/sso-wemx/", [
        'sso_secret' => "xxxxxxx",
        'user_id' => 1
    ]);

    if (!$response->successful()) {
        $message = $response['success'] && !$response['success']
            ? $response['message']
            : 'Something went wrong, please contact an administrator.';

        return redirect()->back()->withError($message);
    }

    return redirect()->intended($response['redirect']);
}
bash
php artisan vendor:publish --tag=sso-wemx
shell
php artisan wemx:generate