A Filament plugin for creating and managing landing pages with lead tracking.
composer require vasilgerginski/filament-landing-pages
Run the install command:
php artisan filament-landing-pages:install
This will publish the config file and migrations. Then run:
php artisan migrate
Register the plugin in your Filament panel provider:
use VasilGerginski\FilamentLandingPages\FilamentLandingPagesPlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(FilamentLandingPagesPlugin::make());
}
FilamentLandingPagesPlugin::make()
->landingPages(true) // Enable/disable landing pages resource
->leads(true) // Enable/disable leads resource
->navigationGroup('Marketing')
->navigationIcon('heroicon-o-rectangle-stack')
->navigationSort(3)
Create a custom block class:
namespace App\Filament\Blocks;
use Filament\Forms\Components\Builder\Block;
use Filament\Forms\Components\TextInput;
class MyCustomBlock
{
public static function make(): Block
{
return Block::make('my_custom_block')
->label('My Custom Block')
->schema([
TextInput::make('title')->required(),
]);
}
}
Register in config:
// config/filament-landing-pages.php
'blocks' => [
'custom_blocks' => [
'my_custom_block' => \App\Filament\Blocks\MyCustomBlock::class,
],
],
Create a corresponding Livewire component and Blade view for frontend rendering.
Extend AbstractTemplate:
namespace App\LandingPageTemplates;
use VasilGerginski\FilamentLandingPages\Templates\AbstractTemplate;
class MyTemplate extends AbstractTemplate
{
public function getName(): string
{
return 'My Template';
}
public function getSections(): array
{
return [
[
'type' => 'hero_section',
'data' => [
'title' => 'Welcome',
'subtitle' => 'Your subtitle here',
],
],
// Add more sections...
];
}
}
Register in config:
'templates' => [
'custom_templates' => [
'my_template' => \App\LandingPageTemplates\MyTemplate::class,
],
],
Override the default models:
// config/filament-landing-pages.php
'models' => [
'landing_page' => \App\Models\LandingPage::class,
'lead' => \App\Models\Lead::class,
],
Landing pages are accessible at:
/{prefix}/{slug} (default prefix: landing)/{prefix}-preview/{slug}Configure in config/filament-landing-pages.php:
'routes' => [
'prefix' => 'landing',
'middleware' => ['web'],
'locale_prefix' => false, // Set true for /{locale}/landing/{slug}
],
The package supports optional integration with artesaos/seotools:
// config/filament-landing-pages.php
'seo' => [
'enabled' => true,
'seo_tools_facade' => \Artesaos\SEOTools\Facades\SEOTools::class,
],
composer test
See CHANGELOG.md for recent changes.
MIT License. See LICENSE for details.