1. Go to this page and download the library: Download geniusauth/laravel 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/ */
use GeniusAuth\Laravel\Facades\GeniusAuthLink;
// Sync the current OIDC user to GeniusAuth
$result = GeniusAuthLink::syncToGeniusAuth(
externalUserId: '123',
phone: '+2250701020304',
email: '[email protected]',
name: 'Alice',
phoneVerified: true,
);
// Look up a user by GeniusID
$user = GeniusAuthLink::lookupByGeniusId('@2250701020304');
use GeniusAuth\Laravel\Facades\GeniusAuth;
use Illuminate\Http\Request;
class AuthController
{
public function signIn()
{
return GeniusAuth::redirect();
}
public function dashboard(Request $request)
{
$user = GeniusAuth::user();
return view('dashboard', ['user' => $user]);
}
public function logout()
{
GeniusAuth::logout();
return redirect()->route('home');
}
}
use GeniusAuth\Laravel\Contracts\UserRepositoryInterface;
$this->app->bind(UserRepositoryInterface::class, App\Repositories\GeniusAuthUserRepository::class);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.