Common Issues - Streats22/LaraGrapePackage GitHub Wiki
Comprehensive guide for resolving common issues with LaraGrape installation, setup, and usage.
Symptoms:
-
php artisan laragrape:setup
fails with errors - Files not published correctly
- Namespace issues
Solutions:
# Clear all caches
php artisan optimize:clear
php artisan config:clear
php artisan cache:clear
php artisan view:clear
# Try setup again
php artisan laragrape:setup --all
# If still failing, try with force
php artisan laragrape:setup --all --force
Check:
- Laravel version (requires Laravel 12+)
- PHP version (requires PHP 8.2+)
- Composer dependencies installed
- File permissions
Symptoms:
- Admin panel not accessible
- Filament commands not found
Solutions:
# Install Filament
php artisan filament:install --panels
# Create admin user
php artisan make:filament-user
# Check if admin panel is accessible
# Visit: http://your-site.test/admin
Symptoms:
- Migration errors
- Tables not created
- Column type issues
Solutions:
# Rollback and re-run migrations
php artisan migrate:rollback
php artisan migrate
# Or fresh install
php artisan migrate:fresh --seed
# Check migration files exist
ls database/migrations/
Symptoms:
- Empty block manager
- 404 errors for block previews
- Blocks not appearing
Solutions:
# Clear block cache
php artisan cache:clear
# Check block files exist
ls resources/views/filament/blocks/
# Verify block metadata format
# Should have: {{-- @block id="..." label="..." --}}
# Check BlockService is working
php artisan tinker
>>> use App\Services\BlockService;
>>> $service = new BlockService();
>>> dd($service->getBlocks());
Common Block Issues:
- Missing metadata comments
- Incorrect file extensions (must be
.blade.php
) - Wrong directory structure
- Syntax errors in block files
Symptoms:
- Console errors:
Failed to load resource: 404
- Block previews not loading
Solutions:
# Check route exists
php artisan route:list | grep block-preview
# Verify AdminPageController exists
ls app/Http/Controllers/AdminPageController.php
# Clear route cache
php artisan route:clear
# Check block IDs match
# Frontend should use simple IDs (e.g., 'button')
# Not category prefixes (e.g., 'components/button')
Symptoms:
- Custom blocks not appearing
- Visual builder not working
- Preview not updating
Solutions:
# Check custom blocks table
php artisan tinker
>>> use App\Models\CustomBlock;
>>> CustomBlock::where('is_active', true)->get();
# Verify block is active
# Check in admin panel: Custom Blocks → Edit Block → Active = Yes
# Clear cache
php artisan cache:clear
Symptoms:
- Editor not appearing
- JavaScript errors in console
- Alpine.js errors
Solutions:
# Build frontend assets
npm install
npm run build
# Check Alpine.js is installed
npm list alpinejs
# Install if missing
npm install alpinejs
# Clear browser cache
# Hard refresh (Ctrl+F5 or Cmd+Shift+R)
Symptoms:
- Tailwind classes not working
- Custom CSS not loading
- Theme not applying
Solutions:
# Rebuild Tailwind CSS
php artisan tailwind:rebuild
# Check Tailwind config
cat tailwind.config.js
# Verify CSS files exist
ls public/css/
ls resources/css/
# Check for active TailwindConfig
php artisan tinker
>>> use App\Models\TailwindConfig;
>>> TailwindConfig::where('is_active', true)->first();
Symptoms:
- 404 errors for pages
- Page content not showing
- Route not found
Solutions:
# Check routes
php artisan route:list | grep pages
# Verify page exists and is published
php artisan tinker
>>> use App\Models\Page;
>>> Page::where('slug', 'your-page-slug')->published()->first();
# Check page controller
ls app/Http/Controllers/PageController.php
# Clear route cache
php artisan route:clear
Symptoms:
- Resources not appearing in admin
- "Resource not found" errors
- Missing menu items
Solutions:
# Check resource files exist
ls app/Filament/Resources/
# Verify namespaces are correct
# Should be: namespace App\Filament\Resources;
# Clear Filament cache
php artisan filament:cache
# Check AdminPanelProvider
cat app/Providers/Filament/AdminPanelProvider.php
Symptoms:
- Editor not loading in admin
- Save not working
- Preview not updating
Solutions:
# Check GrapesJsEditor component
ls app/Filament/Forms/Components/GrapesJsEditor.php
# Verify JavaScript assets
ls public/js/
ls resources/js/
# Check for JavaScript errors in browser console
# Look for CORS issues or missing files
Symptoms:
- Pages load slowly
- Editor takes time to initialize
- Block loading delays
Solutions:
# Enable caching
php artisan config:cache
php artisan route:cache
php artisan view:cache
# Optimize assets
npm run build --production
# Check for large block files
# Consider lazy loading for complex blocks
# Monitor database queries
# Use Laravel Debugbar for development
Symptoms:
- PHP memory limit exceeded
- Timeout errors
- Server crashes
Solutions:
# Increase PHP memory limit
# In php.ini: memory_limit = 512M
# Increase max execution time
# In php.ini: max_execution_time = 300
# Check for memory leaks in custom blocks
# Limit block complexity and file sizes
# Enable debug mode
# In .env: APP_DEBUG=true
# View logs
tail -f storage/logs/laravel.log
# Check configuration
php artisan config:show
# List all routes
php artisan route:list
# Check service providers
php artisan config:cache
// Check Alpine.js components
console.log('Alpine components:', window.Alpine);
// Check GrapesJS
console.log('GrapesJS:', window.grapesjs);
// Check for JavaScript errors
// Open browser dev tools → Console tab
# Check database connection
php artisan tinker
>>> DB::connection()->getPdo();
# Check table structure
php artisan tinker
>>> Schema::getColumnListing('pages');
>>> Schema::getColumnListing('custom_blocks');
>>> Schema::getColumnListing('site_settings');
>>> Schema::getColumnListing('tailwind_configs');
# Clear all caches
php artisan optimize:clear
# Rebuild assets
npm run build
# Update Tailwind CSS
php artisan tailwind:rebuild
# Check for updates
composer update
npm update
# Complete reset (WARNING: Deletes all data)
php artisan migrate:fresh --seed
# Reinstall LaraGrape
php artisan laragrape:setup --all --force
# Rebuild everything
npm run build
php artisan tailwind:rebuild
php artisan optimize:clear
- Check this troubleshooting guide
- Search existing issues on GitHub
- Check Laravel and Filament documentation
- Verify your environment meets requirements
Include:
- Laravel version (
php artisan --version
) - PHP version (
php --version
) - Error messages and stack traces
- Steps to reproduce
- Environment details (OS, server, etc.)
# System information
php artisan about
# Check requirements
php artisan laragrape:setup --help
# Test services
php artisan tinker
>>> app(\App\Services\BlockService::class)->getBlocks();
>>> app(\App\Services\SiteSettingsService::class)->getSettings();
# Check file permissions
ls -la resources/views/filament/blocks/
ls -la app/Filament/Resources/
When experiencing issues, try this order:
- ✅ Clear all caches:
php artisan optimize:clear
- ✅ Rebuild assets:
npm run build
- ✅ Check file permissions: Ensure write access
- ✅ Verify database: Check tables and data
- ✅ Test services: Use Tinker to test services
- ✅ Check browser console: Look for JavaScript errors
- ✅ Verify routes: Check if routes are registered
- ✅ Test in isolation: Create minimal test case
- Installation Guide
- [Block System](Block System.md)
- [API Reference](Api Reference.md)
- [Component System](Block System.md)
Most issues can be resolved with proper cache clearing and asset rebuilding! 🔧
For persistent issues, check the GitHub issues or create a new one with detailed information.