1. Go to this page and download the library: Download geekcodev/filament-max-chat 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/ */
geekcodev / filament-max-chat example snippets
use GeekCo\FilamentMaxChat\FilamentMaxChatPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(FilamentMaxChatPlugin::make());
}
use GeekCo\FilamentMaxChat\Services\MaxMessageService;
class HandleMaxUpdateListener
{
public function __construct(private MaxMessageService $chatMessages) {}
public function handle(MaxUpdateReceived $event): void
{
if ($event->update->updateType === UpdateType::MessageCreated) {
$this->chatMessages->storeIncoming($event->update);
}
}
}