jobmetric/laravel-package-core
Composer 安装命令:
composer require jobmetric/laravel-package-core
包简介
It is a standard package of different components of Laravel that helps you write different packages better and more fluently
README 文档
README
Laravel Package Core
Ship Packages Faster. Keep Architecture Consistent.
Laravel Package Core is the shared foundation behind JobMetric Laravel packages. Stop retyping the same provider wiring, CRUD scaffolding, and response boilerplate in every package and start building domain features with a single, opinionated toolkit. It provides a robust and flexible layer for package bootstrapping, container registration, reusable service patterns, dynamic model relations, resource resolution, and predictable HTTP and service responses—giving you the same structural conventions across packages without sacrificing clarity. This is where serious package development meets developer-friendly consistency—so every new package feels familiar to your team and to integrators.
Why Laravel Package Core?
Fluent Package Bootstrapping
Configure what your package registers and publishes—config, migrations, routes, translations, views, assets, commands, and bindings—through one provider-oriented flow instead of scattering ad hoc mergeConfigFrom, loadMigrationsFrom, and publishes calls across custom providers.
Reusable CRUD Service Layer
Model domain services with query support, lifecycle hooks, event dispatching, and standardized response contracts using AbstractCrudService, matching patterns already proven in packages like Flow.
Dynamic Relation Mapping
Register relations at runtime with HasDynamicRelations so host applications can extend package models without maintaining forks or editing vendor classes.
Resource Resolution and Morph Attributes
Resolve context-aware resources with ResourceResolveEvent and attach morph-based dynamic attributes with HasMorphResourceAttributes for flexible APIs and admin experiences.
Predictable Controller and Service Responses
Keep response shapes consistent with Output\Response and Controllers\HasResponse, reducing bespoke array payloads duplicated across controllers and services.
Utilities That Match the Ecosystem
Use console scaffolding helpers, enum-oriented utilities, boolean status helpers, and global helper functions aligned with other JobMetric packages.
What is Laravel Package Core?
Laravel Package Core is the structural glue for multi-package Laravel ecosystems: it standardizes how packages boot, bind services, publish assets, implement CRUD-style services, and return structured results.
In a typical Laravel monorepo or suite of first-party packages, teams often repeat the same infrastructure work in every provider and service. Laravel Package Core takes a different approach:
- One bootstrap vocabulary: Register package capabilities through shared provider patterns instead of one-off copies in each package
- Shared CRUD conventions: Query, hooks, events, and response contracts through
AbstractCrudService - Runtime-safe extensibility: Attach relations and resolve resources without rewriting package internals
- Consistent responses: Traits and value objects that keep controllers and domain services speaking the same language
- Cross-package helpers: Small utilities and console helpers that behave the same wherever they appear
Consider a domain package that ships migrations, config, routes, and a service consumed by host apps, while still allowing integrators to attach extra relations to your Eloquent models. With Laravel Package Core, you wire bootstrap concerns once, expose predictable service and HTTP responses, and let applications extend models at runtime. The power of a shared core lies not only in saving lines of code but also in making every package easier to onboard, review, and evolve.
What Awaits You?
By adopting Laravel Package Core, you will:
- Bootstrap packages consistently - One pattern for config, routes, migrations, translations, and bindings
- Reduce duplicated infrastructure - Shared helpers, traits, and base services instead of copy-paste providers
- Extend packages safely - Dynamic relations and resource resolution without editing vendor models
- Align responses everywhere - Predictable shapes for controllers and domain services
- Move faster on new packages - Spend time on domain logic, not repeated wiring
- Maintain clean code - Conventions that mirror other JobMetric packages your team already uses
Quick Start
Install Laravel Package Core via Composer:
composer require jobmetric/laravel-package-core
Documentation
Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Package Core:
The documentation includes:
- Getting Started - Quick introduction and how the package fits the ecosystem
- Installation - Requirements and Composer setup
- Showcase - Real-world wiring from projects that already depend on this foundation
- Package Core Service Provider - Bootstrap capabilities, registration, and publishable resources
- Abstract CRUD Service - Domain services, queries, hooks, events, and responses
- Dynamic Relations and Resources -
HasDynamicRelations,ResourceResolveEvent, and morph resource attributes - Controllers and Responses -
HasResponseand structuredOutput\Responseusage - Utilities - Helpers, console tools, enum patterns, and boolean status helpers
Contributing
Thank you for participating in laravel-package-core. A contribution guide can be found here.
License
The laravel-package-core is open-sourced software licensed under the MIT license. See License File for more information.
jobmetric/laravel-package-core 适用场景与选型建议
jobmetric/laravel-package-core 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.7k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2023 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「tools」 「laravel」 「core」 「jobmetric」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jobmetric/laravel-package-core 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jobmetric/laravel-package-core 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jobmetric/laravel-package-core 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
A Laravel package to retrieve data from Google Search Console
GHT D-Tools Bundle
Allow KoolReport to use twig template engine to render view
Asynchronous MQTT client built on React
统计信息
- 总下载量: 2.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 14
- 依赖项目数: 40
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-05