PHP code example of happenv-com / filament-presence
1. Go to this page and download the library: Download happenv-com/filament-presence 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/ */
happenv-com / filament-presence example snippets
use Happenv\FilamentPresence\FilamentPresencePlugin;
$panel->plugin(FilamentPresencePlugin::make());
use Filament\Panel;
use Happenv\FilamentPresence\FilamentPresencePlugin;
public function panel(Panel $panel): Panel
{
return $panel->plugin(FilamentPresencePlugin::make());
}
use Happenv\FilamentPresence\Concerns\InteractsWithPresence;
class EditOrder extends EditRecord
{
use InteractsWithPresence;
public function shouldCollectPresence(): bool
{
return false; // disable presence on this page
}
}
use Happenv\FilamentPresence\Events\UserEnteredPage;
use Happenv\FilamentPresence\Events\UserLeftPage;
// UserEnteredPage->visit (userId, roomKey, url, label, enteredAt)
// UserLeftPage->visit, ->leftAt, ->durationSeconds