diff --git a/public/docs/core-concepts/bootstrapping/initializers/event-binding.md b/public/docs/core-concepts/bootstrapping/initializers/event-binding.md index 0081fe1..4c67675 100644 --- a/public/docs/core-concepts/bootstrapping/initializers/event-binding.md +++ b/public/docs/core-concepts/bootstrapping/initializers/event-binding.md @@ -1,5 +1,10 @@ # Event Bindings +> **Related interfaces:** +> - [HasEventBindings](/packages/event/interfaces/has-event-bindings) — The interface you implement +> - [ActionBindingStrategy](/packages/event/interfaces/action-binding-strategy) — Executes the bindings +> - [Event](/packages/event/interfaces/event) — Creating event classes + ## What are Event Bindings? Event bindings are like adapters that connect your application's events to a platform's native event system. Think of @@ -229,4 +234,18 @@ Remember: - Document platform events clearly - Use service classes for complex transformations -With event bindings, your application can easily "speak" to any platform while keeping its own code clean and portable. \ No newline at end of file +With event bindings, your application can easily "speak" to any platform while keeping its own code clean and portable. + +--- + +## Related Documentation + +### Event Package Interfaces +- [HasEventBindings](/packages/event/interfaces/has-event-bindings) — Detailed interface documentation +- [ActionBindingStrategy](/packages/event/interfaces/action-binding-strategy) — How bindings are executed +- [Event](/packages/event/interfaces/event) — Creating event classes that bindings produce + +### Related Guides +- [Event Listeners](event-listeners) — Handling events once they're bound +- [Event Package Overview](/packages/event/introduction) — Full event system documentation +- [Best Practices](/packages/event/patterns/best-practices) — Transformer patterns, testing strategies \ No newline at end of file diff --git a/public/docs/core-concepts/bootstrapping/initializers/event-listeners.md b/public/docs/core-concepts/bootstrapping/initializers/event-listeners.md index df47d6a..ee5e20a 100644 --- a/public/docs/core-concepts/bootstrapping/initializers/event-listeners.md +++ b/public/docs/core-concepts/bootstrapping/initializers/event-listeners.md @@ -1,5 +1,10 @@ # Event Listeners in PHPNomad +> **Related interfaces:** +> - [HasListeners](/packages/event/interfaces/has-listeners) — Declaring which events to listen for +> - [CanHandle](/packages/event/interfaces/can-handle) — Creating handler classes +> - [Event](/packages/event/interfaces/event) — Creating event classes + Event listeners are like friendly observers in your code that wait for specific things to happen, and then spring into action when they do. Think of them as helpful assistants who are always ready to respond when something important occurs in your application. @@ -250,4 +255,20 @@ maintain but also easier to test and modify. Each listener can focus on its spec any services it needs. Think of event listeners as specialized workers in your application - each one has access to exactly the tools they -need (through dependency injection) and knows exactly what to do when certain events occur. \ No newline at end of file +need (through dependency injection) and knows exactly what to do when certain events occur. + +--- + +## Related Documentation + +### Event Package Interfaces +- [HasListeners](/packages/event/interfaces/has-listeners) — Detailed interface documentation for declaring listeners +- [CanHandle](/packages/event/interfaces/can-handle) — Creating handler classes with dependency injection +- [Event](/packages/event/interfaces/event) — Creating event classes +- [EventStrategy](/packages/event/interfaces/event-strategy) — Broadcasting events programmatically + +### Related Guides +- [Event Bindings](event-binding) — Connecting platform events to your application +- [Event Package Overview](/packages/event/introduction) — Full event system documentation +- [Best Practices](/packages/event/patterns/best-practices) — Handler patterns, testing strategies, anti-patterns +- [Logger Package](/packages/logger/introduction) — LoggerStrategy interface used in handler examples \ No newline at end of file diff --git a/public/docs/core-concepts/bootstrapping/initializers/facades.md b/public/docs/core-concepts/bootstrapping/initializers/facades.md index 752dcdc..2b5e8ef 100644 --- a/public/docs/core-concepts/bootstrapping/initializers/facades.md +++ b/public/docs/core-concepts/bootstrapping/initializers/facades.md @@ -290,4 +290,12 @@ Consider alternatives when: Remember: Facades in PHPNomad combine the singleton pattern with static access to provide convenient, globally accessible services while maintaining the flexibility to work across different platforms. The key is to use them -thoughtfully and always remember to include the `WithInstance` trait. \ No newline at end of file +thoughtfully and always remember to include the `WithInstance` trait. + +--- + +## Related Documentation + +- [Singleton Package](/packages/singleton/introduction) — WithInstance trait used by all facades +- [Logger Package](/packages/logger/introduction) — LoggerStrategy interface shown in examples +- [Event Package](/packages/event/introduction) — EventStrategy interface for event facades \ No newline at end of file diff --git a/public/docs/core-concepts/datastores/getting-started-tutorial.md b/public/docs/core-concepts/datastores/getting-started-tutorial.md index 5bf4dd2..61589c6 100644 --- a/public/docs/core-concepts/datastores/getting-started-tutorial.md +++ b/public/docs/core-concepts/datastores/getting-started-tutorial.md @@ -806,6 +806,7 @@ Now that you have built your first datastore, explore these topics to deepen you - **[Query Building](../packages/database/query-building)** — Build complex queries with conditions - **[Junction Tables](../packages/database/junction-tables)** — Implement many-to-many relationships - **[Advanced Patterns](../advanced/advanced-patterns)** — Soft deletes, audit trails, and optimization +- **[Logger Package](../packages/logger/introduction)** — LoggerStrategy interface for handler logging --- diff --git a/public/docs/packages/database/caching-and-events.md b/public/docs/packages/database/caching-and-events.md index 7e85a5c..9d5b242 100644 --- a/public/docs/packages/database/caching-and-events.md +++ b/public/docs/packages/database/caching-and-events.md @@ -562,6 +562,12 @@ public function save(Model $item): Model { --- +## Related Documentation + +* [Event Package](/packages/event/introduction) — Core event interfaces (`Event`, `EventStrategy`, `CanHandle`) +* [Event Listeners](/core-concepts/bootstrapping/initializers/event-listeners) — Setting up event listeners in initializers +* [Event Bindings](/core-concepts/bootstrapping/initializers/event-binding) — Binding platform events to application events + ## What's Next * [Database Handlers](/packages/database/handlers/introduction) — handlers that use caching and events diff --git a/public/docs/packages/database/database-service-provider.md b/public/docs/packages/database/database-service-provider.md index b8270d8..d1014d5 100644 --- a/public/docs/packages/database/database-service-provider.md +++ b/public/docs/packages/database/database-service-provider.md @@ -469,3 +469,5 @@ $serviceProvider->getQueryBuilder() // Doesn't exist * [Database Handlers](/packages/database/handlers/introduction) — handlers that use the provider * [Query Building](/packages/database/query-building) — using QueryBuilder and ClauseBuilder * [Caching and Events](/packages/database/caching-and-events) — using CacheableService and EventStrategy +* [Logger Package](/packages/logger/introduction) — LoggerStrategy interface documentation +* [Event Package](/packages/event/introduction) — EventStrategy interface documentation diff --git a/public/docs/packages/database/handlers/identifiable-database-datastore-handler.md b/public/docs/packages/database/handlers/identifiable-database-datastore-handler.md index a893668..f95f78f 100644 --- a/public/docs/packages/database/handlers/identifiable-database-datastore-handler.md +++ b/public/docs/packages/database/handlers/identifiable-database-datastore-handler.md @@ -438,3 +438,4 @@ Business logic belongs in services, not handlers. * [Database Handlers Introduction](/packages/database/handlers/introduction) — overview of handler architecture * [Query Building](/packages/database/query-building) — building custom queries * [Caching and Events](/packages/database/caching-and-events) — customizing cache and event behavior +* [Logger Package](/packages/logger/introduction) — LoggerStrategy interface for error logging diff --git a/public/docs/packages/database/introduction.md b/public/docs/packages/database/introduction.md index 7d7b909..7c8cca8 100644 --- a/public/docs/packages/database/introduction.md +++ b/public/docs/packages/database/introduction.md @@ -47,6 +47,7 @@ see_also: - handlers/introduction - tables/introduction - table-schema-definition + - ../logger/introduction noindex: false --- @@ -410,7 +411,8 @@ If your data comes from REST APIs, GraphQL, or other non-database sources, you d - **[phpnomad/datastore](../datastore/introduction)** — Defines interfaces that database handlers implement - **phpnomad/models** — Provides DataModel interface (covered in [Models and Identity](../../core-concepts/models-and-identity)) -- **phpnomad/events** — EventStrategy interface for broadcasting events +- **[phpnomad/event](../event/introduction)** — EventStrategy interface for broadcasting events +- **[phpnomad/logger](../logger/introduction)** — LoggerStrategy interface for operation logging --- diff --git a/public/docs/packages/datastore/traits/introduction.md b/public/docs/packages/datastore/traits/introduction.md index d39d7ce..6a4bf7d 100644 --- a/public/docs/packages/datastore/traits/introduction.md +++ b/public/docs/packages/datastore/traits/introduction.md @@ -264,3 +264,4 @@ To understand how handlers work and what they're responsible for, see: - [Core Implementation](/packages/datastore/core-implementation) — when to use traits vs manual implementation - [Database Handlers](/packages/database/handlers/introduction) — the handler side of the delegation contract - [Datastore Interfaces](/packages/datastore/interfaces/introduction) — the public contracts these traits implement +- [Logger Package](/packages/logger/introduction) — LoggerStrategy for logging in decorators diff --git a/public/docs/packages/datastore/traits/with-datastore-decorator.md b/public/docs/packages/datastore/traits/with-datastore-decorator.md index 79da848..f2c6dda 100644 --- a/public/docs/packages/datastore/traits/with-datastore-decorator.md +++ b/public/docs/packages/datastore/traits/with-datastore-decorator.md @@ -196,3 +196,4 @@ Most handlers extend this interface with additional capabilities (e.g., `Datasto * [Datastore Interface](/packages/datastore/interfaces/datastore) — the interface this trait implements * [WithDatastorePrimaryKeyDecorator](/packages/datastore/traits/with-datastore-primary-key-decorator) — adds `find()` method * [Core Implementation](/packages/datastore/core-implementation) — when to use traits vs manual implementation +* [Logger Package](/packages/logger/introduction) — LoggerStrategy interface used in examples above diff --git a/public/docs/packages/datastore/traits/with-datastore-primary-key-decorator.md b/public/docs/packages/datastore/traits/with-datastore-primary-key-decorator.md index 038d63c..7c4b7a9 100644 --- a/public/docs/packages/datastore/traits/with-datastore-primary-key-decorator.md +++ b/public/docs/packages/datastore/traits/with-datastore-primary-key-decorator.md @@ -201,3 +201,4 @@ This ensures the handler supports primary key lookups. * [DatastoreHasPrimaryKey Interface](/packages/datastore/interfaces/datastore-has-primary-key) — the interface this trait implements * [WithDatastoreWhereDecorator](/packages/datastore/traits/with-datastore-where-decorator) — adds query-builder methods * [Database Handlers](/packages/database/handlers/introduction) — the handler side of the contract +* [Logger Package](/packages/logger/introduction) — LoggerStrategy interface used in examples above diff --git a/public/docs/packages/datastore/traits/with-datastore-where-decorator.md b/public/docs/packages/datastore/traits/with-datastore-where-decorator.md index 4364570..0775857 100644 --- a/public/docs/packages/datastore/traits/with-datastore-where-decorator.md +++ b/public/docs/packages/datastore/traits/with-datastore-where-decorator.md @@ -227,3 +227,4 @@ This ensures the handler supports query-builder operations. * [DatastoreHasWhere Interface](/packages/datastore/interfaces/datastore-has-where) — the interface this trait implements * [WithDatastorePrimaryKeyDecorator](/packages/datastore/traits/with-datastore-primary-key-decorator) — adds `find()` method * [Query Building](/packages/database/query-building) — how handlers implement query builders +* [Logger Package](/packages/logger/introduction) — LoggerStrategy interface used in examples above diff --git a/public/docs/packages/rest/interceptors/included-interceptors/event-interceptor.md b/public/docs/packages/rest/interceptors/included-interceptors/event-interceptor.md index bc8e678..fe93244 100644 --- a/public/docs/packages/rest/interceptors/included-interceptors/event-interceptor.md +++ b/public/docs/packages/rest/interceptors/included-interceptors/event-interceptor.md @@ -1,5 +1,7 @@ # EventInterceptor +> **See also:** [Event Package](/packages/event/introduction) for the core `Event` and `EventStrategy` interfaces. + The `EventInterceptor` is a built-in interceptor in PHPNomad designed for **publishing events** after a controller has completed its work. It lets you broadcast domain events in response to API calls, keeping controllers free of side-effect logic. diff --git a/public/docs/packages/rest/interceptors/introduction.md b/public/docs/packages/rest/interceptors/introduction.md index c7bd27b..91ba946 100644 --- a/public/docs/packages/rest/interceptors/introduction.md +++ b/public/docs/packages/rest/interceptors/introduction.md @@ -115,4 +115,11 @@ confusion and unintended side effects. * Use interceptors to **enforce cross-cutting policies** (envelopes, headers, serialization), not domain logic. * Be explicit about **which interceptors run where**—avoid magical or hidden behaviors. -Following these practices ensures interceptors stay predictable, reusable, and maintainable over time. \ No newline at end of file +Following these practices ensures interceptors stay predictable, reusable, and maintainable over time. + +--- + +## Related Documentation + +- [Logger Package](../../logger/introduction.md) - LoggerStrategy interface used for request logging +- [Included Interceptors](./included-interceptors/introduction.md) - Pre-built interceptors in PHPNomad \ No newline at end of file