filaforge/filament-database-viewer
Composer 安装命令:
composer require filaforge/filament-database-viewer
包简介
Database viewer plugin: Database viewer with table browser and data explorer
README 文档
README
A powerful Filament plugin that provides a comprehensive database viewing and exploration interface directly in your admin panel.
Features
- Table Browser: Navigate through all database tables and views
- Data Viewer: View table contents with pagination and sorting
- Schema Explorer: Examine table structure, columns, and relationships
- Search & Filter: Find specific data with advanced filtering options
- Export Capabilities: Download table data in multiple formats
- Relationship Mapping: Visualize table relationships and foreign keys
- Query Builder: Simple query interface for data exploration
- Performance Monitoring: Track query execution times
- Multi-Database Support: Work with multiple database connections
Installation
1. Install via Composer
composer require filaforge/database-viewer
2. Publish & Migrate
# Publish provider groups (config, views, migrations) php artisan vendor:publish --provider="Filaforge\\DatabaseViewer\\Providers\\DatabaseViewerServiceProvider" # 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\DatabaseViewer\DatabaseViewerPlugin::make()); }
Setup
Configuration
The plugin will automatically:
- Publish configuration files to
config/database-viewer.php - Publish view files to
resources/views/vendor/database-viewer/ - Publish migration files to
database/migrations/ - Register necessary routes and middleware
Database Configuration
Configure the viewer in the published config file:
// config/database-viewer.php return [ 'connections' => ['mysql', 'pgsql', 'sqlite'], 'max_rows_per_page' => 100, 'enable_search' => true, 'enable_export' => true, 'allowed_operations' => ['SELECT', 'SHOW', 'DESCRIBE'], 'cache_results' => true, 'cache_ttl' => 300, // 5 minutes ];
Environment Variables
Add these to your .env file if needed:
DB_VIEWER_ENABLED=true DB_VIEWER_MAX_ROWS=100 DB_VIEWER_CACHE_TTL=300
Usage
Accessing the Database Viewer
- Navigate to your Filament admin panel
- Look for the "Database Viewer" menu item
- Start exploring your database structure
Browsing Tables
- Select Connection: Choose the database connection to explore
- Browse Tables: View all available tables and views
- View Structure: Examine table columns, types, and constraints
- Explore Data: Browse table contents with pagination
- Search Data: Use search and filter options to find specific records
Data Exploration
- Table Navigation: Switch between different tables
- Column Information: View column details, types, and constraints
- Data Sorting: Sort data by any column
- Pagination: Navigate through large datasets
- Export Data: Download table data in CSV, JSON, or Excel format
Advanced Features
- Relationship View: See foreign key relationships between tables
- Query Builder: Build simple queries to explore data
- Schema Export: Export table schemas for documentation
- Performance Stats: Monitor query performance and execution times
Troubleshooting
Common Issues
- Permission denied: Ensure the user has database read access
- Slow performance: Check pagination settings and enable caching
- Missing tables: Verify database connection and user permissions
- Memory issues: Reduce max_rows_per_page setting
Debug Steps
- Check the plugin configuration:
php artisan config:show database-viewer
- Verify routes are registered:
php artisan route:list | grep database-viewer
- Test database connectivity:
php artisan tinker
# Test database connection manually
- Check database permissions:
# Verify the database user has SELECT privileges
- Clear caches:
php artisan optimize:clear
- Check logs for errors:
tail -f storage/logs/laravel.log
Performance Optimization
- Enable result caching in configuration
- Use appropriate pagination limits
- Optimize database indexes for frequently viewed columns
- Consider read-only database connections for viewing
Security Considerations
Access Control
- Role-based permissions: Restrict access to authorized users only
- Read-only access: Use database users with SELECT privileges only
- Connection isolation: Separate viewing connections from application connections
- Audit logging: Track all database viewing activities
Best Practices
- Never expose database viewer to public users
- Use dedicated database users with minimal permissions
- Regularly review and update access controls
- Monitor and log all database access
- Implement query timeouts to prevent long-running queries
Uninstall
1. Remove Plugin Registration
Remove the plugin from your panel provider:
// remove ->plugin(\Filaforge\DatabaseViewer\DatabaseViewerPlugin::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-viewer.php rm -rf resources/views/vendor/database-viewer
4. Remove Package and Clear Caches
composer remove filaforge/database-viewer php artisan optimize:clear
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-viewer 适用场景与选型建议
filaforge/filament-database-viewer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 190 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「platform」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 filaforge/filament-database-viewer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 filaforge/filament-database-viewer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 filaforge/filament-database-viewer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
Alfabank REST API integration
Press package for Orchid Platform
A foundation to build applications using Phalcon.
统计信息
- 总下载量: 190
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-19