zaheensayyed / filament-cms
Filament CMS is a powerful package designed to streamline content management system (CMS) development using Laravel and Filament. It offers a fast and flexible solution for building dynamic, user-friendly interfaces for managing content, empowering developers to create and deploy CMS applications wi
Fund package maintenance!
Requires
- php: ^8.2
- bezhansalleh/filament-shield: ^3.3
- doctrine/dbal: ^3.5.1
- filament/filament: ^3.0
- filament/forms: ^3.0
- filament/tables: ^3.0
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Pages, multi-level menus, galleries, SEO tags, site settings and a contact form for Laravel sites, managed in a Filament panel and rendered with plain Blade.
Note: this README describes the upcoming v1.1.0 (see Unreleased). For the current release, read the v1.0.6 README.
| PHP | Laravel | Filament |
|---|---|---|
| 8.1+ | 10.x | 3.x |
Features
- Pages with a rich-text editor, a description, a Heroicon and per-page SEO fields
- Blog: posts with drafts, scheduled publishing, cover images and SEO;
/blogroutes andFilamentCms::getPosts()(docs) - Menus: a Main Menu and a Footer Menu with 2 levels, linking to pages, galleries or custom URLs, plus static (non-clickable) labels; Heroicon icons on child items; cached
- Catch-all route that serves pages and galleries by slug (works with
route:cache) - Galleries with image uploads on any filesystem disk
- Clients as cards (logo, title, description) on one
/clientspage; featured clients for the home page (docs) - SEO component: title, description, canonical, robots, Open Graph, Twitter, JSON-LD
- Settings page with Company Info, SEO Defaults and Contact Form tabs, extensible; read with
FilamentCms::setting()(key reference) - Users & roles with Filament Shield:
adminandcontent_managerroles out of the box (docs) - Contact form (
<x-filament-cms::contact-form />, routefilament-cms.contact.submit) with SMTP delivery through your mailer, spam protection and a submission log in the panel
Installation
composer require zaheensayyed/filament-cms
Add use Spatie\Permission\Traits\HasRoles; to your User model, then:
php artisan filament-cms:install php artisan filament-cms:roles --admin=you@example.com php artisan storage:link
Register the plugin in your panel provider:
use zaheensayyed\FilamentCms\FilamentCmsPlugin; $panel->plugins([ FilamentCmsPlugin::make(), ]);
Serve CMS pages by slug on the frontend by adding FILAMENT_CMS_ROUTES=true to .env, and
the blog at /blog with FILAMENT_CMS_BLOG_ROUTES=true and clients at /clients with
FILAMENT_CMS_CLIENT_ROUTES=true.
Upgrading from 1.0.x? Menus, routing and relations changed: follow UPGRADE.md.
Usage
<head> <x-filament-cms::seo :page="$page ?? null" /> </head> <body> <nav> @foreach (FilamentCms::getMenu('main-menu') as $item) <a href="{{ $item->url }}">{{ $item->title }}</a> @endforeach </nav> <x-filament-cms::contact-form /> <footer>{{ FilamentCms::setting('company.email') }}</footer> </body>
FilamentCms::getMenu('main-menu'); // cached menu items with url, title, childItems FilamentCms::getPage('about-us'); // ?Page FilamentCms::getGallery('event-2017'); // ?Gallery with images FilamentCms::resolveSlug('about/team'); // Page, Gallery or null FilamentCms::getPosts(); // published blog posts, paginated FilamentCms::featuredClients(); // clients marked Featured, in the panel's order FilamentCms::setting('company.email'); // settings value, cached
Documentation
Full guide in docs/: installation · concepts · menus · routing & pages · blog · galleries · clients · SEO · contact form · settings · roles · customization
Upgrading? Read UPGRADE.md. Release notes: CHANGELOG.md.
License
MIT, see LICENSE.md.