afea/filament-hero

Hero banner module for the Afea Filament CMS package ecosystem: headline, description, badge, feature bullets, CTA and background image.

Maintainers

Package info

github.com/AfeaSoftware/filament-hero

pkg:composer/afea/filament-hero

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:49 UTC


README

Hero banner module for the Afea Filament CMS package ecosystem.

Ships:

  • Hero model — headline + description + optional badge + CTA + feature bullets + image
  • Multiple heroes supported (for A/B testing, localized variants, seasonal campaigns)
  • Reorderable Filament v4 HeroResource with a feature Repeater
  • HeroPlugin + afea:install:hero

Installation

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

Register in AdminPanelProvider:

->plugin(\Afea\Cms\Hero\Filament\HeroPlugin::make())

Three common scenarios

1. Render the primary hero on the home page

use Afea\Cms\Hero\Models\Hero;

$hero = Hero::query()->active()->ordered()->first();

$hero?->title;
$hero?->description;
$hero?->featureList();        // sorted [{icon, title, order}, ...]
$hero?->imageUrl('preview');  // webp preview

2. Localize or A/B test heroes

Run multiple active heroes with distinct order values and pick one on the front-end based on session/locale:

$heroes = Hero::query()->active()->ordered()->get();
$hero = $heroes->firstWhere('description', 'like', "%{$locale}%") ?? $heroes->first();

3. Override the model with a featured scope

class Hero extends \Afea\Cms\Hero\Models\Hero
{
    public function scopeForCampaign($q, string $utm)
    {
        return $q->active()->where('cta_url', 'like', "%utm_campaign={$utm}%");
    }
}
'models' => ['hero' => \App\Models\Hero::class],