streats22/laragrape

A Laravel package for GrapesJS + Filament block builder integration.

1.2.1 2025-07-18 12:43 UTC

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 metadata
  • custom_blocks - User-created blocks
  • site_settings - Site configuration
  • tailwind_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

🎨 Customization

Adding Custom Blocks

  1. Use the visual block builder in the admin panel
  2. Or create .blade.php files in resources/views/filament/blocks/
  3. 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. πŸ‡