PHP code example of firmantr3 / laravel-sso

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

    

firmantr3 / laravel-sso example snippets


    'providers' => [
        'admins' => [
            'driver' => 'sso',
            'model' => App\Admin::class,
        ],

        'teachers' => [
            'driver' => 'sso',
            'model' => App\Teacher::class,
        ],

        'students' => [
            'driver' => 'sso',
            'model' => App\Student::class,
        ],
    ],



namespace App\Admin;

use Firmantr3\LaravelSSO\Models\User;

class Admin extends User
{
    public $timestamps = false;

    protected $table = 'admins';
}


$credential = Firmantr3\LaravelSSO\Models\Credential::first();

$admin = $credential->attachUser(\App\Admin::create());

$adminClass = \App\Admin::class;
$adminAttributes = [];

$admin = $credential->createAuthenticatableUser($adminClass, $adminAttributes);
bash
php artisan vendor:publish