streats22/laragrape
最新稳定版本:1.2.1
Composer 安装命令:
composer require streats22/laragrape
包简介
A Laravel package for GrapesJS + Filament block builder integration.
README 文档
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
/adminto 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.phpfiles 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. 🍇
统计信息
- 总下载量: 113
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-30