PHP code example of wjbecker / filament-connectify

1. Go to this page and download the library: Download wjbecker/filament-connectify 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/ */

    

wjbecker / filament-connectify example snippets


use Wjbecker\FilamentConnectify\FilamentConnectifyPlugin;

return $panel
    // ...
    ->plugins([
        // ... Other Plugins
        FilamentConnectifyPlugin::make()
            // (ckage
                ]
            ])
            // (optional) restrict login callback
            ->isAllowedCallback(function (\SocialiteProviders\Manager\OAuth2\User $socialiteUser) {
                $decodedToken = json_decode(base64_decode(str_replace('_', '/', str_replace('-','+',explode('.', $socialiteUser->token)[1]))));
                return $decodedToken->tid === {{azure_tenant_id}};
            })
            // (optional) change the user model class
            ->userModel(\App\Models\User::class)
            // (optional) change redirect url callback
            ->redirectUrlCallback(function ($provider) {
                return 'https://'.tenant('id').'.foo.test'.route(FilamentConnectifyPlugin::get()->getCallbackRoute(), $provider, false);
            })
    ])

'azure' => [    
  'client_id' => env('AZURE_CLIENT_ID'),
  'client_secret' => env('AZURE_CLIENT_SECRET'),
  'redirect' => env('AZURE_REDIRECT_URI'),
  'tenant' => env('AZURE_TENANT_ID'),
  'proxy' => env('PROXY')  // optionally
],

protected $listen = [
    // ... other listeners
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Azure\AzureExtendSocialite::class.'@handle',
    ],
];
bash
php artisan vendor:publish --tag="filament-connectify-migrations
php artisan migrate