webook / laravel-cms
A lightweight, file-based inline CMS for Laravel that allows direct editing of content on the page
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- illuminate/filesystem: ^10.0|^11.0
- illuminate/http: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
- illuminate/view: ^10.0|^11.0
- symfony/css-selector: ^6.2|^7.0
- symfony/dom-crawler: ^6.2|^7.0
Requires (Dev)
- laravel/pint: ^1.0
- mockery/mockery: ^1.4.4
- orchestra/testbench: ^7.0|^8.0|^9.0
- phpunit/phpunit: ^9.5|^10.0|^11.0
This package is auto-updated.
Last update: 2026-03-16 17:41:40 UTC
README
A Webflow-like inline content management system for Laravel applications.
Installation
1. Install via Composer
composer require webook/laravel-cms
2. Publish Configuration
php artisan vendor:publish --provider="Webook\LaravelCMS\CMSServiceProvider" --tag=cms-config
3. Publish and Run Migrations
php artisan vendor:publish --provider="Webook\LaravelCMS\CMSServiceProvider" --tag=cms-migrations
php artisan migrate
4. Create Storage Link
For image uploads to work properly, you need to create a symbolic link:
php artisan storage:link
5. Publish Assets (Optional)
If you want to customize the CMS assets:
php artisan vendor:publish --provider="Webook\LaravelCMS\CMSServiceProvider" --tag=cms-assets
Configuration
The configuration file will be published to config/cms.php. You can customize:
- Toolbar settings: Position (top/bottom), theme (dark/light), auto-injection
- Storage settings: Disk and path for media uploads
- Cache settings: Enable/disable caching, TTL
- Editor settings: Toolbar buttons available in the rich text editor
- Media settings: Upload disk, path, max file size, allowed file types
Usage
Basic Usage
Once installed, the CMS toolbar will automatically be injected into your pages when enabled.
- Navigate to any page in your application
- Click "Edit" in the toolbar to enter edit mode
- Hover over any content to see editable areas
- Click to edit text inline
- For images, hover to see the gear icon for changing images
- Click "Save" to persist changes
Permissions
By default, the CMS is available without authentication. To restrict access, add your own middleware to the configuration:
// config/cms.php 'middleware' => [ 'web', 'auth', // Add authentication 'can:edit-content', // Add authorization ],
Excluding Content
To prevent content from being editable, add the data-cms-ignore attribute:
<div data-cms-ignore="true"> This content won't be editable </div>
Database Content
Content fetched from database models will automatically be marked as "coming soon" and won't be editable yet.
Features
- ✅ Inline content editing
- ✅ Rich text editor with formatting options
- ✅ Image upload with drag-and-drop
- ✅ Link editing
- ✅ Automatic backup system
- ✅ Dark mode toolbar
- ✅ Mobile responsive
- ✅ Pages explorer
- ✅ Multi-language ready (coming soon)
- ✅ Media library (coming soon)
Troubleshooting
Images return 403 Forbidden
Make sure you've created the storage link:
php artisan storage:link
Content changes don't persist
Clear the view cache after updates:
php artisan view:clear php artisan config:clear
Toolbar doesn't appear
-
Check that CMS is enabled in your
.env:CMS_ENABLED=true -
Clear caches:
php artisan cache:clear php artisan config:clear
Requirements
- PHP 8.1 or higher
- Laravel 10.x or 11.x
License
MIT License
Support
For issues and questions, please use the GitHub issue tracker.