xslainadmin/livewire-crud
Composer 安装命令:
composer require 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.
关键字:
README 文档
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:installand 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.
xslainadmin/livewire-crud 适用场景与选型建议
xslainadmin/livewire-crud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 135 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「redis」 「admin」 「generator」 「bootstrap」 「search」 「import」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 xslainadmin/livewire-crud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xslainadmin/livewire-crud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 xslainadmin/livewire-crud 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Microservice RPC through message queues.
2lenet/EasyAdminPlusBundle
The CodeIgniter Redis package
贝嘟分布式缓存扩展
Analysis module for finding problematical shop data.
统计信息
- 总下载量: 135
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 34
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-23