harrym/domain-support 问题修复 & 功能扩展

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

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

harrym/domain-support

最新稳定版本:2.2.2

Composer 安装命令:

composer require harrym/domain-support

包简介

Laravel Domain Support

README 文档

README

This project is a Laravel package named harrym/domain-support. It provides a set of abstract classes and utilities to support a domain-driven architecture within a Laravel application. The package promotes a structured and consistent way of building applications by providing base classes for common architectural components like actions, repositories, models, and controllers.

The package is built for PHP 8.4+ and Laravel. It has a key dependency on spatie/laravel-data.

Key Concepts

The package provides the following abstract classes to be extended by the application's concrete classes:

  • AbstractAction: Used for business logic. Actions are dispatchable and have a handle method where the logic is implemented.
  • AbstractConstant: A utility class to manage and retrieve constants from a class.
  • AbstractAPIController: A base controller for API endpoints. It includes the SendsJsonResponse trait for standardized JSON responses.
  • AbstractWebController: A base controller for web routes.
  • AbstractEvent: A base class for domain events, incorporating common Laravel event traits.
  • AbstractException: A custom exception base class.
  • AbstractModel: A base Eloquent model that includes SoftDeletes and HasFactory traits, and configures pagination based on the domain-support.php config file.
  • AbstractRepository: A repository pattern implementation that provides a fluent interface for querying data. It supports searching, sorting, pagination, and filtering using a CriteriaInterface.

Installation

Install the package via Composer:

composer require harrym/domain-support

Configuration

The package's configuration file can be published using the following command:

php artisan vendor:publish --provider="HarryM\DomainSupport\DomainSupportServiceProvider" --tag="domain-support.config"

This will create a config/domain-support.php file in the application's config directory.

Testing and Development

Testing

The project uses Pest and PHPUnit for testing. The tests are located in the tests directory. To run the tests, use the following command:

composer test

Coding Style

The project uses laravel/pint for code style. To format the code, run:

composer pint

Static Analysis

The project uses larastan/larastan for static analysis. To run the analysis, use:

composer analyse

Automated Refactoring

The project uses rector/rector for automated refactoring. The configuration is in rector.php. To run rector, use:

composer rector

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固