filaforge/filament-database-tools
Composer 安装命令:
composer require filaforge/filament-database-tools
包简介
Combined database viewer and query builder for FilamentPHP - A comprehensive tool for database management
README 文档
README
A comprehensive Filament plugin that provides essential database management tools directly in your admin panel.
Features
- Database Backup: Create and manage database backups
- Schema Management: View and modify database structure
- Data Import/Export: Bulk data operations with multiple formats
- Query Optimization: Analyze and optimize database queries
- Table Management: Create, modify, and drop database tables
- Index Management: Manage database indexes for performance
- User Management: Database user and permission management
- Monitoring: Real-time database performance monitoring
- Migration Tools: Advanced migration management utilities
Installation
1. Install via Composer
composer require filaforge/database-tools
2. Publish & Migrate
# Publish provider groups (config, views, migrations) php artisan vendor:publish --provider="Filaforge\\DatabaseTools\\Providers\\DatabaseToolsServiceProvider" # Run migrations php artisan migrate
3. Register Plugin
Add the plugin to your Filament panel provider:
use Filament\Panel; public function panel(Panel $panel): Panel { return $panel // ... other configuration ->plugin(\Filaforge\DatabaseTools\DatabaseToolsPlugin::make()); }
Setup
Configuration
The plugin will automatically:
- Publish configuration files to
config/database-tools.php - Publish view files to
resources/views/vendor/database-tools/ - Publish migration files to
database/migrations/ - Register necessary routes and middleware
Database Configuration
Configure database tools in the published config file:
// config/database-tools.php return [ 'backup' => [ 'enabled' => true, 'path' => storage_path('backups/database'), 'retention_days' => 30, ], 'import' => [ 'max_file_size' => '10MB', 'allowed_extensions' => ['csv', 'xlsx', 'json'], ], 'export' => [ 'chunk_size' => 1000, 'timeout' => 300, ], 'permissions' => [ 'admin_only' => true, 'allowed_roles' => ['admin', 'database_manager'], ], ];
Environment Variables
Add these to your .env file if needed:
DB_TOOLS_BACKUP_ENABLED=true DB_TOOLS_BACKUP_PATH=storage/backups/database DB_TOOLS_MAX_FILE_SIZE=10MB
Usage
Accessing Database Tools
- Navigate to your Filament admin panel
- Look for the "Database Tools" menu item
- Choose the tool you want to use
Database Backup
- Create Backup: Generate a new database backup
- Schedule Backups: Set up automatic backup schedules
- Download Backups: Download backup files locally
- Restore Backups: Restore from previous backups
- Manage Retention: Configure backup retention policies
Schema Management
- View Tables: Browse all database tables and their structure
- Modify Schema: Add, modify, or remove columns
- Create Tables: Build new tables with custom schemas
- Drop Tables: Safely remove unused tables
- View Relationships: Explore table relationships and foreign keys
Data Import/Export
- Import Data: Upload CSV, Excel, or JSON files
- Export Data: Download table data in various formats
- Bulk Operations: Perform operations on large datasets
- Data Validation: Validate imported data before insertion
- Error Handling: Manage import/export errors gracefully
Query Optimization
- Query Analysis: Analyze slow queries and bottlenecks
- Index Suggestions: Get recommendations for new indexes
- Performance Monitoring: Track query execution times
- Query History: Review and optimize previous queries
Troubleshooting
Common Issues
- Permission denied: Ensure the user has database management rights
- Backup failures: Check disk space and write permissions
- Import timeouts: Adjust chunk size and timeout settings
- Memory limits: Large operations may exceed PHP memory limits
Debug Steps
- Check the plugin configuration:
php artisan config:show database-tools
- Verify routes are registered:
php artisan route:list | grep database-tools
- Test database connectivity:
php artisan tinker
# Test database connection manually
- Check backup directory permissions:
ls -la storage/backups/database
- Clear caches:
php artisan optimize:clear
- Check logs for errors:
tail -f storage/logs/laravel.log
Performance Optimization
- Use smaller chunk sizes for large imports
- Schedule backups during low-traffic periods
- Monitor disk space for backup storage
- Use appropriate indexes for frequently queried columns
Security Considerations
Access Control
- Role-based permissions: Restrict access to authorized users only
- Database privileges: Use dedicated database users with limited permissions
- Audit logging: Track all database operations and changes
- Backup security: Secure backup files and access
Best Practices
- Never expose database tools to public users
- Regularly review and update user permissions
- Encrypt sensitive backup files
- Monitor and log all database changes
- Use read-only database users when possible
Uninstall
1. Remove Plugin Registration
Remove the plugin from your panel provider:
// remove ->plugin(\Filaforge\DatabaseTools\DatabaseToolsPlugin::make())
2. Roll Back Migrations (Optional)
php artisan migrate:rollback
# or roll back specific published files if needed
3. Remove Published Assets (Optional)
rm -f config/database-tools.php rm -rf resources/views/vendor/database-tools
4. Remove Package and Clear Caches
composer remove filaforge/database-tools php artisan optimize:clear
5. Clean Up Backups (Optional)
rm -rf storage/backups/database
Support
- Documentation: GitHub Repository
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This plugin is open-sourced software licensed under the MIT license.
Made with ❤️ by the Filaforge Team
filaforge/filament-database-tools 适用场景与选型建议
filaforge/filament-database-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 08 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「admin」 「query」 「tools」 「panel」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 filaforge/filament-database-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 filaforge/filament-database-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 filaforge/filament-database-tools 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
2lenet/EasyAdminPlusBundle
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Query filtering in your frontend
Anax Database Active Record module for model classes.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-19