Download the PHP package yacoubalhaidari/organization-chart without Composer
On this page you can find all versions of the php package yacoubalhaidari/organization-chart. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yacoubalhaidari/organization-chart
More information about yacoubalhaidari/organization-chart
Files in yacoubalhaidari/organization-chart
Package organization-chart
Short Description A Filament plugin to display organization charts using Highcharts
License MIT
Homepage https://github.com/yacoubalhaidari/organization-chart
Informations about the package organization-chart
Filament Organization Chart Widget
A powerful and elegant Filament widget plugin for creating interactive organizational charts. Built on top of Highcharts, this package provides a fluent API for visualizing your company's hierarchy with style.
✨ Features
- 🎨 Beautiful & Interactive - Smooth, responsive charts with hover effects and animations
- 🏗️ Fluent Builder API - Intuitive, chainable methods for building complex hierarchies
- 👤 Employee Profiles - Support for profile images, titles, and custom styling
- 🎯 Fully Customizable - Control colors, layout, height, and orientation
- 📱 Responsive Design - Works seamlessly on desktop, tablet, and mobile
- 🌍 Multi-language - Built-in support for English and Arabic (easily extensible)
- ✅ Smart Validation - Automatic error checking and helpful debugging tools
- 🚀 Database Ready - Easily integrate with Eloquent models
- 🎨 Artisan Command - Quick scaffold widgets with
make:organization-chart
📋 Table of Contents
- Requirements
- Installation
- Quick Start
- Usage Examples
- API Reference
- Customization
- Building from Source
- Contributing
- License
🔧 Requirements
- PHP: 8.1 or higher
- Laravel: 10.x or 11.x or 12.x
- Filament: 3.x or 4.x
- Composer: 2.x
📦 Installation
Step 1: Install via Composer
Step 2: Publish Assets
The package assets are automatically published during installation. If needed, you can republish them:
Step 3: Create Your First Widget
Use the artisan command to scaffold a new organization chart widget:
This creates a ready-to-use widget at app/Filament/Widgets/CompanyOrgChartWidget.php.
Step 4: Register the Widget
Add the widget to your Filament Panel Provider (e.g., app/Providers/Filament/AdminPanelProvider.php):
That's it! 🎉 Visit your Filament dashboard to see your organization chart.
🚀 Quick Start
Using the Artisan Command (Recommended)
Generate a widget with pre-configured examples:
This creates a widget with:
- 4 executive-level positions (CEO, CTO, CFO, COO)
- Profile images and custom colors
- Commented examples for departments and teams
- Best practices and proper structure
Manual Widget Creation
Alternatively, create a widget manually:
💡 Usage Examples
Example 1: Simple Hierarchy
Example 2: Multi-Level Organization
Example 3: Database Integration
Example 4: Horizontal Layout
📚 API Reference
Artisan Commands
| Command | Description | Example |
|---|---|---|
make:organization-chart |
Generate a new widget | php artisan make:organization-chart CompanyChart |
Command Usage:
Builder Methods
Configuration Methods
| Method | Parameters | Default | Description |
|---|---|---|---|
title() |
string $title |
'Organization Chart' |
Set chart title |
height() |
int $pixels |
700 |
Set height in pixels |
inverted() |
bool $inverted |
true |
Vertical (true) or horizontal (false) |
Example:
Hierarchy Definition Methods
| Method | Description | Returns |
|---|---|---|
executiveLevel(array $relationships) |
Define top-level relationships | self |
departments(array $relationships) |
Define department relationships | self |
teams(array $relationships) |
Define team relationships | self |
Relationship Format: [['parentId', 'childId'], ...]
Example:
Node Definition Methods
| Method | Description | Level |
|---|---|---|
executiveNodes(array $nodes) |
Define executive details | Executive |
departmentNodes(array $nodes) |
Define department details | Department |
teamNodes(array $nodes) |
Define team details | Team |
nodes(array $nodes) |
Define all nodes at once | All |
Node Properties:
| Property | Type | Required | Description | Example |
|---|---|---|---|---|
id |
string |
✅ Yes | Unique identifier | 'CEO' |
name |
string |
✅ Yes | Display name | 'John Smith' |
title |
string |
No | Job title | 'Chief Executive Officer' |
image |
string |
No | Profile photo URL | 'https://example.com/photo.jpg' |
color |
string |
No | Hex color | '#3b82f6' |
column |
int |
No | Column position | 0, 1, 2 |
Example:
Validation Methods
| Method | Returns | Description |
|---|---|---|
validate() |
array |
Check for errors |
getMissingNodes() |
array |
Get missing node IDs |
getAllRequiredIds() |
array |
Get all required IDs |
getSummary() |
array |
Get statistics |
Example:
🎨 Customization
Widget Views
Use the alternative view without description:
Custom Colors
Profile Images
Translations
Publish and customize translation files:
Edit in:
lang/vendor/organization-chart/en/widget.php(English)lang/vendor/organization-chart/ar/widget.php(Arabic)
Widget Column Span
Control widget width:
🛠️ Building from Source
If you're contributing or want to build assets from source:
Prerequisites
- Node.js 16.x or higher
- NPM 8.x or higher
Build Steps
Build Commands
| Command | Description |
|---|---|
npm run build |
Build CSS and JS for production |
npm run build:css |
Build CSS only |
npm run build:js |
Build JS only |
npm run dev |
Same as build (no watch mode) |
After Building
Publish the updated assets to your Filament application:
Project Structure
🐛 Troubleshooting
Chart Not Displaying
Problem: Widget shows but chart is blank.
Solutions:
- Clear cache:
php artisan optimize:clear - Republish assets:
php artisan filament:assets - Check browser console for JavaScript errors
- Verify Highcharts is loaded
Missing Nodes Error
Problem: Relationships reference undefined IDs.
Solution: Use validation to find issues:
Assets Not Loading
Problem: Styles or JavaScript not working.
Solutions:
- Re-publish:
php artisan filament:assets --force - Clear browser cache (Ctrl+F5)
- Check public directory permissions
- Verify assets exist in
public/js/yacoubalhaidari/andpublic/css/yacoubalhaidari/
🤝 Contributing
Contributions are welcome! Here's how you can help:
Development Setup
- Fork the repository
- Clone your fork
- Install dependencies:
composer install && npm install - Make your changes
- Build assets:
npm run build - Test your changes
- Submit a pull request
Guidelines
- Follow PSR-12 coding standards
- Write clear commit messages
- Add tests for new features
- Update documentation as needed
- Ensure assets build without errors
Reporting Issues
Please open an issue on GitHub with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Environment details (PHP, Laravel, Filament versions)
📄 License
This package is open-sourced software licensed under the MIT License.
👤 Author
Yacoub Al-haidari
- Email: [email protected]
- GitHub: @yacoubalhaidari
🙏 Credits
Built With:
- Filament - The elegant admin panel framework
- Highcharts - Interactive charting library
- Laravel - The PHP framework for web artisans
🔗 Links
⭐ Support
If you find this package helpful, please consider:
- ⭐ Starring the repository
- 🐛 Reporting issues
- 💡 Suggesting new features
- 📖 Improving documentation
- 🔀 Contributing code
Made with ❤️ for the Filament community
All versions of organization-chart with dependencies
filament/filament Version ^3.0|^4.0|^5.0
spatie/laravel-package-tools Version ^1.15.0