jobmetric/laravel-package-core

It is a standard package of different components of Laravel that helps you write different packages better and more fluently

Maintainers

Package info

github.com/jobmetric/laravel-package-core

Homepage

Forum

pkg:composer/jobmetric/laravel-package-core

Fund package maintenance!

majidmohammadian

Statistics

Installs: 1 632

Dependents: 39

Suggesters: 0

Stars: 9

Open Issues: 0

1.38.0 2026-03-13 09:31 UTC

README

Contributors Forks Stargazers MIT License LinkedIn

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:

📚 Read Full Documentation →

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 - HasResponse and structured Output\Response usage
  • 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.