PHP code example of oneofftech / laravel-connect-identity
1. Go to this page and download the library: Download oneofftech/laravel-connect-identity 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/ */
oneofftech / laravel-connect-identity example snippets
// ...
use Oneofftech\Identities\WithIdentities;
class User extends Authenticatable
{
use WithIdentities;
// ...
}
'gitlab' => [
'client_id' => env('GITLAB_CLIENT_ID'),
'client_secret' => env('GITLAB_CLIENT_SECRET'),
'redirect' => null, // set in the controller no need to specify
'instance_uri' => env('GITLAB_INSTANCE_URI', 'https://gitlab.com/')
// 'host' => env('GITLAB_INSTANCE_URI', 'https://gitlab.com/') // if using the default Socialite Gitlab driver
],
public function boot()
{
parent::boot();
\Oneofftech\Identities\Facades\Identity::events();
}
use Oneofftech\Identities\Facades\Identity;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Identity::useNamespace("My\\Namespace\\");
Identity::useIdentityModel("My\\Namespace\\Identity");
Identity::useUserModel("My\\Namespace\\User");
// ...
}
}