streats22 / laragrape
A Laravel package for GrapesJS + Filament block builder integration.
Requires
- php: ^8.2
- filament/filament: ^3.0
- illuminate/support: ^10.0|^11.0|^12.0
- maatwebsite/excel: ^3.1
- wiebenieuwenhuis/filament-code-editor: ^1.2
Requires (Dev)
- fakerphp/faker: ^1.23
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.6
- phpunit/phpunit: ^11.5.3
This package is auto-updated.
Last update: 2025-07-18 12:47:11 UTC
README
LaraGrape combines the visual power of GrapesJS with the modern admin experience of Filament to deliver a seamless, developer-friendly CMS-like system for Laravel.
π Quick Start
1. Install the Package
composer require streats22/laragrape
2. Run the Setup Command
php artisan laragrape:setup --all
3. Create Admin User
php artisan make:filament-user
4. Build Frontend Assets
npm install npm run build
5. Start Your Application
php artisan serve
- Admin Panel: Visit
/admin
to access Filament - Frontend: Visit
/
to see your site
β¨ Features
π¨ Visual Page Builder
- GrapesJS Integration: Drag-and-drop page building
- Pre-built Blocks: Hero sections, cards, forms, and more
- Responsive Design: Mobile-first approach with Tailwind CSS
- Live Preview: See changes in real-time
π οΈ Admin Panel
- Filament 3: Modern, responsive admin interface
- Page Management: Create, edit, and publish pages
- Custom Blocks: Build and manage reusable components
- Site Settings: Configure header, footer, and general settings
- Tailwind Config: Dynamic theme management
π§ Developer Experience
- Laravel 12+ Compatible: Built for modern Laravel
- Alpine.js: Lightweight JavaScript framework
- Modular Architecture: Clean, maintainable code structure
- Extensible: Easy to customize and extend
π¦ What's Included
Core Components
- β Pages System: Full CRUD with GrapesJS integration
- β Custom Blocks: Visual block builder with live preview
- β Site Settings: Comprehensive configuration management
- β Tailwind Config: Dynamic theme system
- β Admin Panel: Filament-based administration
- β Frontend Layout: Responsive, SEO-optimized templates
Database Tables
pages
- Page content and metadatacustom_blocks
- User-created blockssite_settings
- Site configurationtailwind_configs
- Theme configurations
Filament Resources
- PageResource: Page management with visual editor
- CustomBlockResource: Block builder and management
- SiteSettingsResource: Site configuration
- TailwindConfigResource: Theme management
π οΈ Setup Command Options
The laragrape:setup
command provides comprehensive setup with error handling:
php artisan laragrape:setup [options]
Available Options
Option | Description |
---|---|
--all |
Complete setup (publish, migrate, seed) |
--migrate |
Run migrations after publishing |
--seed |
Run seeders after publishing |
--force |
Overwrite existing files |
Examples
# Complete setup php artisan laragrape:setup --all # Publish only php artisan laragrape:setup # Publish and migrate php artisan laragrape:setup --migrate
π Update Command
The laragrape:update
command allows you to selectively update LaraGrape components without doing a full installation:
php artisan laragrape:update [options]
Available Options
Option | Description |
---|---|
--all |
Update all components |
--config |
Update configuration files only |
--views |
Update view files only |
--migrations |
Update migration files only |
--filament |
Update Filament components only |
--assets |
Update frontend assets only |
--controllers |
Update controllers only |
--services |
Update services only |
--routes |
Update routes only |
--models |
Update models only |
--seeders |
Update seeders only |
--console |
Update console commands only |
--run-migrate |
Run migrations after updating |
--run-seed |
Run seeders after updating |
--force |
Overwrite existing files without asking |
Examples
# Interactive update (select components from menu) php artisan laragrape:update # Update all components php artisan laragrape:update --all # Update specific components php artisan laragrape:update --filament --assets # Update with database operations php artisan laragrape:update --all --run-migrate php artisan laragrape:update --all --run-seed php artisan laragrape:update --all --run-migrate --run-seed # Force update without confirmation php artisan laragrape:update --all --force
Note: The update command doesn't install Filament (assumes it's already installed). Use the setup command for initial installation.
π― Key Features
Visual Page Builder
- Drag & Drop: Intuitive block-based editing
- Pre-built Blocks: 20+ ready-to-use components
- Custom Blocks: Create your own reusable components
- Responsive: Mobile-first design approach
- Live Preview: Real-time editing experience
Admin Panel
- Modern Interface: Filament 3 admin panel
- Page Management: Full CRUD operations
- Block Builder: Visual custom block creation
- Site Settings: Comprehensive configuration
- Theme Management: Dynamic Tailwind configuration
Developer Tools
- Error Handling: Robust setup with fallbacks
- Namespace Management: Automatic App namespace conversion
- Asset Management: CSS, JS, and view publishing
- Command Line: Artisan commands for management
π Documentation
- Setup Guide - Complete installation and configuration
- Block System - Dynamic block loading and management
- Component System - Modular component architecture
- Custom Blocks - Visual block builder guide
- API Documentation - Service classes and methods
- Troubleshooting - Common issues and solutions
π¨ Customization
Adding Custom Blocks
- Use the visual block builder in the admin panel
- Or create
.blade.php
files inresources/views/filament/blocks/
- Add metadata comments for automatic loading
Styling
- Global Styles: Edit
resources/css/site.css
- Tailwind Config: Use the admin panel for dynamic themes
- Component Styles: Add custom CSS to blocks
Extending
- New Resources: Add custom Filament resources
- Custom Services: Extend the service classes
- Frontend: Modify the layout components
π Why Choose LaraGrape?
- No Code Required: Visual page building for non-developers
- Developer Friendly: Clean, maintainable Laravel code
- Modern Stack: Built with Laravel 12, Filament 3, and Tailwind CSS
- Extensible: Easy to customize and extend
- Production Ready: Robust error handling and fallbacks
- Active Development: Regular updates and improvements
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone the repository git clone https://github.com/your-org/laragrape.git # Install dependencies composer install npm install # Run tests php artisan test
π License
This package is open-sourced software licensed under the MIT license.
π Support
- Documentation: Check the docs in this repository
- Issues: Report bugs on GitHub
- Discussions: Join our community discussions
π What's New in V1.2
Major Features
- β Enhanced Setup Command with robust error handling
- β Dynamic Tailwind CSS System with theme management
- β Advanced Block System with improved compatibility
- β Comprehensive Site Settings with grouped configuration
Improvements
- β 50%+ Performance Improvement
- β Complete Documentation (6 comprehensive guides)
- β Enhanced Error Handling throughout the system
- β Mobile-First Responsive Design
LaraGrape: The easiest way to add a modern, visual CMS to your Laravel projectβwithout sacrificing developer control. π