PHP code example of hyvor / laravel-hyvor-connecter

1. Go to this page and download the library: Download hyvor/laravel-hyvor-connecter 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/ */

    

hyvor / laravel-hyvor-connecter example snippets


public int $id;
public string $username;
public string $name;
public string $email;
public ?string $picture_url;
public ?string $location;
public ?string $bio;
public ?string $website_url;

use Hyvor\HyvorConnecter\Login;

$user = Login::check(); // null | HyvorUser

use Hyvor\HyvorConnecter\Userbase;

// get one from ID (email is not set in the HyvorUser object)
Userbase::fromId($id);

// get one from ID with email
Userbase::fromId($id, true);

// get multiple from ID
Userbase::fromIds([$id1, $id2, ...], bool $email);

Userbase::fromUsername();
Userbase::fromUsernames();
Userbase::fromEmail();
Userbase::fromEmails();

use Hyvor\HyvorConnecter\Redirect;

Redirect::to('account');
Redirect::toLogin();
Redirect::toSignup();