ercos / ercos-cms
CMS based on Laravel and FilamentPHP.
Requires
- php: ^8.1
- filament/filament: ^3.2
- illuminate/contracts: ^10.0 || ^11.0
- pboivin/filament-peek: ^2.2
- spatie/laravel-package-tools: ^1.14.0
- spatie/laravel-sitemap: ^7.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2024-09-13 07:23:15 UTC
README
The Filament Headless CMS package provides a simple and easy to use CMS for Laravel applications.
Features
- Pages : including SEO fields, page blocks, page preview and drafts
- Menus : allows to create and manage menus and sub-menus (with pages, external links, ...) and footer content
- Tiny MCE editor
- Font Awesome Service (Icon Picker)
As this is intended to be headless, we do not provide any frontend views. You can use the provided data to build your own frontend using the API or Laravel functions.
Core
Installation
Install the package via composer :
composer require ercos/ercos-cms
Run the plugin install command.
php artisan ercos-cms:install
Publish the assets
php artisan filament:assets
Finally, start adding page sections using the command ercos-cms:make:section {sectionName}
.
Usage
Add the plugin to your Filament installation.
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
...
->plugins([
\Ercos\ErcosCms\Filament\Plugin\CmsPlugin::make()
->navigationGroup('Structure')
->registerNavigation(true) // Optional: Either show the navigation items or not
]);
API routes
- GET /api/pages : list of pages and their content
- GET /api/pages/preview : preview of a page
- GET /api/pages/published-urls : list of published page urls (useful for SSG)
- GET /api/pages/{slug} : get a page by its slug
- GET /api/sitemap : get the sitemap
- GET /api/menus : list of menus and their content
## Useful functions when working with Laravel
- Ercos\ErcosCms\Facades\ErcosCms::getPages() : get all pages
- Ercos\ErcosCms\Facades\ErcosCms::getMenus() : get all menus
TinyMCE
Installation
Add your TinyMCE script in the config file
'tiny_mce' => [
'script' => 'https://cdn.tiny.cloud/1/********/tinymce/7/tinymce.min.js',
...
]
'tiny-mce' => 'https://cdn.tiny.cloud/1/********/tinymce/7/tinymce.min.js'
Usage
TinyMceEditor::make('...')
->label('...')
...
FontAwesome
Installation
Add your Fontawesome css file in the config
'fontawesome' => 'https://kit.fontawesome.com/********.css'
Usage
You may use fontawesome in a Select to choose an icon.
Select::make('...')
->label('...')
->reactive()
->searchable()
->allowHtml()
->getSearchResultsUsing(
fn(string $search) => App::make(FontawesomeService::class)
->searchFontawesomeIconNamesOptions($search)
->pluck('label', 'value')
)
->getOptionLabelUsing(
fn($value) => $value
? App::make(FontawesomeService::class)->getHtmlElement($value)
: null
)
->preload(false)
...
In case you use TinyMCE, fontawesome will also be available.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.