xslainadmin / livewire-crud
Enterprise Laravel Livewire CRUD generator with advanced analytics, calendar management, export/import capabilities, notification systems, and modern Bootstrap 5 UI. Perfect for rapid application development with production-ready components.
Fund package maintenance!
ogoungaemmanuel
Paypal
Installs: 55
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/xslainadmin/livewire-crud
Requires
- php: ^8.1|^8.2|^8.3|^8.4
- aliqasemzadeh/livewire-bootstrap-modal: ^2.3
- barryvdh/laravel-dompdf: ^2.0|^3.1
- intervention/image: ^3.0|^4.0
- laravel/framework: ^9.0|^10.0|^11.0|^12.0
- laravel/sanctum: ^3.0|^4.0|^5.0
- laravel/ui: ^4.0|^5.0
- league/flysystem: ^3.0
- livewire/livewire: ^3.0
- maatwebsite/excel: ^3.1
- php-flasher/flasher-laravel: ^2.1
- pusher/pusher-php-server: ^7.0|^8.0
- spatie/laravel-activitylog: ^4.7|^5.0
- spatie/laravel-permission: ^6.0|^7.0
Requires (Dev)
- fakerphp/faker: ^1.21|^2.0
- larastan/larastan: ^2.0|^3.0
- laravel/pint: ^1.0|^2.0
- mockery/mockery: ^1.4|^2.0
- nunomaduro/collision: ^7.0|^8.0|^9.0
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
- pestphp/pest-plugin-laravel: ^2.0|^3.0
- phpstan/phpstan: ^1.10|^2.0
- phpunit/phpunit: ^10.0|^11.0|^12.0
- rector/rector: ^2.1
- spatie/laravel-ray: ^1.32|^2.0
README
A comprehensive Laravel Livewire CRUD generator package with enterprise-level features including interactive charts, calendar management, advanced export/import capabilities, notification systems, and modern Bootstrap 5 UI. Perfect for rapid application development with production-ready components.
๐ Features
Core CRUD Operations
- Advanced CRUD Generation: Complete Create, Read, Update, Delete operations with modern UI
- Real-time Updates: Powered by Livewire for seamless user experience
- Bulk Operations: Mass delete, bulk edit, and batch processing capabilities
- Advanced Search & Filtering: Multi-column search with real-time filtering
- Pagination: Efficient data pagination with customizable page sizes
๐ Analytics & Visualization
- Interactive Charts: 17+ chart types powered by ApexCharts
- Line, Area, Bar, Column, Pie, Donut, Radial, Scatter
- Heatmaps, Treemaps, Candlestick, Boxplot
- Gauges, Sparklines, Mixed charts
- Real-time Data Updates: Live chart updates with WebSocket support
- Export Charts: PNG, JPG, PDF, SVG export capabilities
- Responsive Design: Mobile-optimized chart rendering
๐ Calendar Management
- Full Calendar Integration: Powered by FullCalendar
- Multiple Views: Month, week, day, list, and timeline views
- Drag & Drop: Interactive event management
- Recurring Events: Support for repeating events
- Event Categories: Color-coded event organization
- Export Options: Calendar export to ICS, PDF formats
๐ Export & Import System
- Multi-format Export: PDF, Excel, CSV, Word documents
- Template System: Customizable export templates
- Batch Processing: Handle large datasets efficiently
- Print Optimization: Professional print layouts
- Security Features: Password protection and watermarks
- Bulk Import: CSV/Excel import with validation
๐ Notification System
- Multi-channel Delivery: Database, email, broadcast, SMS
- Real-time Notifications: Instant updates via WebSockets
- Email Templates: Beautiful, responsive email designs
- Notification Center: Centralized notification management
- Scheduling: Delayed and scheduled notifications
๐จ Modern UI/UX
- Bootstrap 5: Latest Bootstrap framework with custom theming
- Dark Mode: Complete dark/light theme support
- Responsive Design: Mobile-first approach for all devices
- Alpine.js Integration: Reactive components and interactions
- FontAwesome Icons: Comprehensive icon library
- Accessibility: WCAG 2.1 compliant interfaces
๐ง Advanced Features
- Theme System: Multiple pre-built themes and customization
- Multi-language Support: Internationalization ready
- Role-based Access: Permission management integration
- API Generation: RESTful API endpoints with documentation
- Testing Suite: Automated tests for generated components
- Performance Optimization: Query optimization and caching
๐ Requirements
- PHP ^8.0
- Laravel ^9.0|^10.0|^11.0
- Livewire ^3.0
- Node.js ^16.0 (for asset compilation)
- Composer ^2.0
๐ Installation
Step 1: Install via Composer
composer require nwidart/laravel-modules composer require xslainadmin/livewire-crud
Step 2: Install Package Dependencies
php artisan crud:install
This command will:
- Install and configure Bootstrap 5, ApexCharts, FullCalendar
- Set up Alpine.js and FontAwesome
- Configure Webpack/Vite for asset compilation
- Install all JavaScript dependencies
- Compile CSS/JS assets
- Publish configuration files
Step 3: Configure Environment
Add to your .env
file:
# Chart Configuration CHARTS_ENABLED=true CHARTS_DEFAULT_TYPE=line CHARTS_CACHE_DURATION=3600 # Calendar Configuration CALENDAR_ENABLED=true CALENDAR_DEFAULT_VIEW=dayGridMonth CALENDAR_TIME_ZONE=UTC # Export Configuration EXPORT_ENABLED=true EXPORT_MAX_RECORDS=10000 EXPORT_QUEUE_ENABLED=true # Notification Configuration NOTIFICATIONS_ENABLED=true NOTIFICATIONS_CHANNELS=database,mail NOTIFICATIONS_QUEUE=default
Step 4: Run Migrations (Optional)
If you want to use the built-in notification system:
php artisan migrate
๐ฏ Usage
Basic CRUD Generation
Generate a complete CRUD interface for any model:
php artisan crud:generate {table_name} {theme?} {module?}
Example:
php artisan crud:generate users modern php artisan crud:generate products default admin
Available Themes
- default: Clean, professional design
- modern: Contemporary with advanced animations
- minimal: Simplified, focused interface
- dark: Dark-first design approach
Generated Components
Each CRUD generation creates:
๐ Livewire Components
{Model}Component.php
- Main CRUD component{Model}Chart.php
- Analytics component{Model}Calendar.php
- Calendar component{Model}Export.php
- Export component{Model}Import.php
- Import component
๐จ Views
index.blade.php
- Data listing with advanced featurescreate.blade.php
- Creation form with validationedit.blade.php
- Edit form with live updatesshow.blade.php
- Detailed view with related datamodals/
- Modal components for quick actions
๐ Models & Factories
{Model}.php
- Eloquent model with relationships{Model}Factory.php
- Database factory for testing- Migration files with proper indexing
๐ง Notifications
{Model}Created.php
- Creation notification{Model}Updated.php
- Update notification{Model}Deleted.php
- Deletion notification
Advanced Usage Examples
1. Chart Integration
// In your Livewire component public function loadChartData() { return [ 'series' => [ [ 'name' => 'Sales', 'data' => $this->getSalesData() ] ], 'options' => [ 'chart' => ['type' => 'line'], 'xaxis' => ['categories' => $this->getMonths()] ] ]; }
2. Calendar Events
// Define calendar events public function getCalendarEvents() { return $this->model::query() ->select('id', 'title', 'start_date as start', 'end_date as end') ->get() ->map(function ($event) { return [ 'id' => $event->id, 'title' => $event->title, 'start' => $event->start, 'end' => $event->end, 'backgroundColor' => $this->getEventColor($event) ]; }); }
3. Custom Export Templates
// Create custom PDF export public function exportToPdf() { $data = $this->getFilteredData(); return $this->export() ->template('custom.pdf-template') ->data($data) ->filename('report-' . now()->format('Y-m-d')) ->download(); }
4. Real-time Notifications
// Send real-time notification public function notifyUsers($message, $type = 'info') { $this->dispatch('notification', [ 'message' => $message, 'type' => $type, 'timeout' => 5000 ]); }
๐ Configuration
Publishing Configuration Files
php artisan vendor:publish --provider="LivewireCrud\LivewireCrudServiceProvider" --tag=config
Main Configuration (config/livewire-crud.php
)
return [ 'export' => [ 'enabled' => true, 'formats' => ['pdf', 'excel', 'csv'], 'templates' => [ 'pdf' => 'exports.pdf.default', 'excel' => 'exports.excel.default', ], 'security' => [ 'password_protect' => false, 'watermark' => false, ], ], 'charts' => [ 'enabled' => true, 'default_type' => 'line', 'color_scheme' => 'default', 'animations' => true, 'toolbar' => true, ], 'calendar' => [ 'enabled' => true, 'default_view' => 'dayGridMonth', 'time_format' => 'H:mm', 'date_format' => 'YYYY-MM-DD', ], 'notifications' => [ 'enabled' => true, 'channels' => ['database', 'mail'], 'templates' => [ 'mail' => 'notifications.mail.default', ], ], ];
๐จ Customization
Custom Themes
Create your own theme by extending the base theme:
php artisan crud:theme MyCustomTheme
Custom Templates
Override default templates:
php artisan vendor:publish --provider="LivewireCrud\LivewireCrudServiceProvider" --tag=views
Custom Styling
The package uses CSS custom properties for easy theming:
:root { --primary-color: #your-color; --secondary-color: #your-color; --success-color: #your-color; /* ... */ }
๐งช Testing
Run the test suite:
composer test
Generate test coverage:
composer test-coverage
๐ API Reference
Livewire Methods
Method | Description | Parameters |
---|---|---|
loadData() |
Load paginated data | $page , $perPage |
search($query) |
Search records | $query string |
sort($field) |
Sort by field | $field , $direction |
export($format) |
Export data | $format (pdf|excel|csv) |
bulkDelete($ids) |
Delete multiple records | $ids array |
JavaScript API
// Chart management App.charts.create("#chart", options); App.charts.updateData("#chart", newData); // Calendar management App.calendar.init("#calendar", options); App.calendar.addEvent(eventData); // Notifications App.notifications.show(message, type, options);
๐ง Troubleshooting
Common Issues
- Assets not loading: Run
php artisan crud:install
and ensure Node.js dependencies are installed - Charts not rendering: Verify ApexCharts is loaded and check browser console for errors
- Export failing: Ensure proper file permissions and storage configuration
- Calendar not showing: Check FullCalendar dependencies and configuration
Debug Mode
Enable debug mode in configuration:
'debug' => env('CRUD_DEBUG', false),
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
Development Setup
- Fork the repository
- Clone your fork
- Install dependencies:
composer install && npm install
- Run tests:
composer test
- Create feature branch
- Submit pull request
๐ Security
If you discover any security-related issues, please email info@xslain.com instead of using the issue tracker.
๐ License
The MIT License (MIT). Please see License File for more information.
๐ Credits
- Ogounga Emmanuel - Creator & Maintainer
- All Contributors - Community contributors
- ApexCharts - Chart library
- FullCalendar - Calendar component
- Bootstrap - UI framework
- Livewire - Frontend framework
๐ Support
- โญ Star this repository if it helped you!
- ๐ Report bugs
- ๐ก Request features
- ๐ Documentation
- ๐ฌ Discussions
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email info@xslain.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.