<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lanos / laravel-auth0-multi-tenancy-management example snippets
`
use Lanos\Auth0MultiManagement\Modules\User
public function getUsers(){
$users = User::get();
// Alternatively you can apply query paramters as desired
$queryParams = [
"page" => 2,
"per_page" => 20
];
// This will get page 2 of the results with 20 per page
$paginated = User::get($queryParams);
}
`
import Lanos\Auth0MultiManagement\Modules\User
public function getUserOrganizations($userID){
$userOrganizations = User::organizations($userID);
// Alternatively you can apply query paramters as desired
$queryParams = [
"page" => 2,
"per_page" => 20
];
// This will get page 2 of the results with 20 per page
$paginated = User::organizations($queryParams);
}
`
import Lanos\Auth0MultiManagement\Modules\Organization
public function addUsesrToOrganization($organizationID){
$user_ids = [
"auth0|507f1f77bcf86cd799439020",
"auth0|507f1f77bcf86cd198439125",
];
$addUser = Organization::addMembers($organizationID, $user_ids);
// THIS WILL ADD THE 2 ABOVE USER IDS TO THIS ORGANIZATION
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.