PHP code example of richwestcoast / rn-laravel-gsuite

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

    

richwestcoast / rn-laravel-gsuite example snippets




use ColoredCow\LaravelGSuite\Traits\GSuiteLogin;

class LoginController extends Controller
{

    use AuthenticatesUsers, GSuiteLogin;

    // ...

use ColoredCow\LaravelGSuite\Facades\GSuiteUserService;

// ...

$user = GSuiteUserService::fetch('[email protected]');

echo $user->getName(); // Jon Snow
echo $user->getJoinedOn(); // 2016-12-26 12:15:00
echo $user->getDesignation(); // Lord Commander

'multitenancy' => true,

'connections' => [
    'tenant' => 'tenant_connection',
]

'tables' => [
    'tenant' => [
        'gsuite-configurations' => 'your_gsuite_table_name',
    ]
]

'models' => [
    'tenant' => [
        'gsuite-configuration' => App\YourModelName::class
    ]
]

php artisan vendor:publish --provider="ColoredCow\LaravelGSuite\Providers\GSuiteServiceProvider" --tag="config"

php artisan vendor:publish --provider="ColoredCow\LaravelGSuite\Providers\GSuiteServiceProvider" --tag="multitenancy"