PHP code example of liplum / flarum-sync-profile-core
1. Go to this page and download the library: Download liplum/flarum-sync-profile-core 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/ */
liplum / flarum-sync-profile-core example snippets
use Flarum\Extension\ExtensionManager;
use Illuminate\Contracts\Events\Dispatcher;
private ExtensionManager $extensions;
private Dispatcher $dispatcher;
if ($this->extensions->isEnabled('liplum-sync-profile-core')) {
$this->dispatcher->dispatch(new SyncProfileEvent(
"[email protected]",[
"avatarUrl" => "https://example.com/avatar.jpg",
"nickname" => "Test User",
"bio" => "Hello, this is my bio",
"groups" => [1, 15, 2],
"fof/masquerade" => [
"fieldA" => "Example A",
"fieldB" => "Example B",
],
]));
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.