codeages/biz-framework
Biz Framework is a lightweight PHP service-layer framework with a container and core building blocks like config, DB connections/migrations, cache, DAO/service patterns, events, validation, logging, and exceptions—aimed at structuring business logic cleanly.
DomainService, RepositoryInterface), which may require refactoring existing Laravel services.DomainException vs. HttpResponseException)DomainService classes.// Before (Laravel Service)
class OrderService {
public function createOrder() { ... }
}
// After (BizFramework)
class OrderDomainService {
public function createOrder(OrderData $data) { ... }
}
RepositoryInterface implementations.class UserRepository implements RepositoryInterface {
public function findById(int $id) { ... }
}
DomainEvent).DomainCommand).LaravelServiceAdapter to bridge gaps).DomainServiceTestCase).| Step | Task | Dependencies |
|---|---|---|
| 1 | Assess current architecture | Identify "fat" services/controllers. |
| 2 | Refactor one domain (e.g., Orders) | Ensure team buy-in. |
| 3 | Integrate repositories | Replace direct Eloquent calls. |
| 4 | Adopt events/commands | Migrate async logic. |
| 5 | Deprecate old patterns | Phase out legacy services. |
| Risk | Mitigation |
|---|---|
| Package abandonment | Fork and maintain; evaluate alternatives (e.g., Spatie’s Laravel packages). |
| Performance bottlenecks | Benchmark critical paths; optimize repository queries. |
| Team resistance | Pilot with a non-critical feature; provide training. |
| Integration conflicts | Use adapter pattern for Laravel-specific features. |
DomainEvent, DomainCommand).How can I help you explore Laravel packages today?