PHP code example of heyosseus / filum

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

    

heyosseus / filum example snippets


use Heyosseus\Filum\FilumPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugin(FilumPlugin::make());
}

// config/filum.php
'transport' => [
    'driver' => 'polling', // 'auto' (default), 'broadcast', or 'polling'
],

use Heyosseus\Filum\Filum;

Filum::auth(fn ($user) => $user->hasRole('admin'));

'notifications' => [
    'enabled' => env('FILUM_NOTIFICATIONS', true),
],

$this->app->singleton(Heyosseus\Filum\Contracts\Notifier::class, MyNotifier::class);

'groups' => [
    'enabled' => env('FILUM_GROUPS', true),
],

'attachments' => [
    'enabled' => env('FILUM_ATTACHMENTS', true),
    'disk' => env('FILUM_ATTACHMENTS_DISK', 'local'),
    'max_size' => 10240,        // kilobytes
    'max_per_message' => 4,
    'mimes' => ['image/png', 'application/pdf', /* … */],
],

'reactions' => [
    'enabled' => env('FILUM_REACTIONS', true),
    'emoji' => ['👍', '❤️', '😂', '🎉', '👀', '✅'],
],

'messages' => [
    'max_length' => 2000,
    'per_page' => 50,
    'rate_limit' => 30,
    'rate_window' => 60,
    'encrypt' => env('FILUM_ENCRYPT_MESSAGES', true),
],

'presence' => [
    'heartbeat_interval' => 60, // seconds between beats
    'ttl' => 180,               // how long a beat counts as "here"
],

'users' => [
    'model' => App\Models\AdminUser::class,
    'guard' => null,           // null follows the panel's own guard
    'name_column' => 'name',
    'avatar_column' => null,   // e.g. 'avatar_url'
    'provider' => Heyosseus\Filum\Users\ConfiguredUserProvider::class,
],

'enabled' => false,

'overlay' => ['enabled' => false],
bash
composer filum:install
php artisan migrate
bash
composer update heyosseus/filum
php artisan vendor:publish --tag=filum-migrations-groups   # 0.1.x → 0.2.0
php artisan migrate
bash
php artisan vendor:publish --tag=filum-migrations-encryption   # 0.4.x → 1.0.0
php artisan migrate
php artisan filum:encrypt-messages
bash
php artisan vendor:publish --tag=filum-translations