afea/filament-popup

Popup module for the Afea Filament CMS package ecosystem: content popups with trigger rules and target-page matching.

Maintainers

Package info

github.com/AfeaSoftware/filament-popup

pkg:composer/afea/filament-popup

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-04-21 10:48 UTC

This package is auto-updated.

Last update: 2026-04-21 11:57:33 UTC


README

Popup module for the Afea Filament CMS package ecosystem.

Ships:

  • Popup model — content + image, display rules, target-page matching
  • PopupTriggerType enum: immediate, delay, scroll, exit_intent
  • Filament v4 PopupResource with RichEditor (shares afea-cms.rich_content.blocks)
  • PopupPlugin for panel registration
  • afea:install:popup installer

Installation

composer require afea/filament-popup
php artisan afea:install:popup

Register in AdminPanelProvider:

->plugin(\Afea\Cms\Popup\Filament\PopupPlugin::make())

Picking the right popup on the front-end

use Afea\Cms\Popup\Models\Popup;

$popups = Popup::active()
    ->orderBy('order')
    ->get()
    ->filter(fn (Popup $popup) => $popup->matchesPath(request()->path()));

matchesPath() honors both target_pages and exclude_pages, supporting * and /prefix/* globs. Exclusions win over inclusions.

Three common scenarios

1. Show once per visitor

Toggle show_once. Store a cookie on dismiss and skip the popup if present — the flag is just a signal for your front-end.

2. Custom trigger thresholds

display_rules is freeform JSON. The default schema ships with trigger_type, delay_seconds, scroll_percentage, target_pages, exclude_pages. Add your own keys (e.g. device: ['mobile']) by extending the form.

3. Override the Popup model

class Popup extends \Afea\Cms\Popup\Models\Popup
{
    public function scopeForLocale(Builder $q, string $locale): Builder
    {
        return $q->whereJsonContains('display_rules->locales', $locale);
    }
}
'models' => ['popup' => \App\Models\Popup::class],