azaharizaman/laravel-backoffice 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

azaharizaman/laravel-backoffice

最新稳定版本:v1.0.1

Composer 安装命令:

composer require azaharizaman/laravel-backoffice

包简介

A Laravel package for managing hierarchical company structures, offices, departments, staff, and units

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A comprehensive Laravel package for managing hierarchical company structures, offices, departments, staff, and organizational units. This package provides a complete backend solution for complex organizational management without any UI components.

Features

Hierarchical Company Structure

  • Parent-Child Companies: Support for multi-level company hierarchies
  • Office Management: Physical office structures with hierarchical relationships
  • Department Management: Logical department hierarchies
  • Staff Management: Employee assignment to offices and/or departments
  • Unit Management: Logical staff groupings with unit group organization

Key Capabilities

  • Multi-Hierarchy Support: Both physical (offices) and logical (departments) hierarchies
  • Flexible Staff Assignment: Staff can belong to offices, departments, or both
  • Unit Organization: Staff can belong to multiple units within unit groups
  • Organizational Charts: Comprehensive reporting line management with chart generation
  • Export Capabilities: JSON, CSV, and DOT (Graphviz) export formats
  • Office Types: Configurable office type categorization
  • Model Factories: 🆕 Comprehensive factories for all models with rich states for testing
  • Comprehensive Policies: Built-in authorization policies
  • Observer Patterns: Automatic event handling for data changes
  • Console Commands: Management utilities via Artisan commands

Requirements

  • PHP 8.2+
  • Laravel 11.0+ or 12.0+

Installation

You can install the package via composer:

composer require azaharizaman/backoffice

Publish and run the migrations:

php artisan vendor:publish --provider="AzahariZaman\BackOffice\BackOfficeServiceProvider" --tag="backoffice-migrations"
php artisan migrate

Optionally, you can publish the config file:

php artisan vendor:publish --provider="AzahariZaman\BackOffice\BackOfficeServiceProvider" --tag="backoffice-config"

Quick Start

use AzahariZaman\BackOffice\Models\{Company, Office, Staff};
use AzahariZaman\BackOffice\Helpers\OrganizationalChart;

// Create organizational structure using factories
$company = Company::factory()->create(['name' => 'Acme Corp']);
$office = Office::factory()->for($company)->create();

// Create hierarchical staff structure using factories
$ceo = Staff::factory()->ceo()->inOffice($office)->create();
$manager = Staff::factory()->manager()->withSupervisor($ceo)->create();
$employee = Staff::factory()->withSupervisor($manager)->create();

// Generate organizational chart
$chart = OrganizationalChart::forCompany($company);
$stats = OrganizationalChart::statistics($company);

// Export chart data
$csvData = OrganizationalChart::export($company, 'csv');

See the documentation for detailed usage instructions.

Documentation

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-31