PHPackages                             toporia/framework - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. toporia/framework

ActiveLibrary[Framework](/categories/framework)

toporia/framework
=================

Toporia Framework - A modern PHP framework with Clean Architecture

03PHP

Since Dec 21Pushed 4mo agoCompare

[ Source](https://github.com/Minhphung7820/toporia-framework)[ Packagist](https://packagist.org/packages/toporia/framework)[ RSS](/packages/toporia-framework/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Toporia Framework
=================

[](#toporia-framework)

A modern PHP framework built with Clean Architecture principles.

About
-----

[](#about)

Toporia is a PHP framework designed for developers who appreciate clean, maintainable code. While the developer experience (DX) may feel familiar to those who have worked with popular PHP frameworks, **Toporia is built entirely from scratch** - not a fork, clone, or copy of any existing framework.

### Philosophy

[](#philosophy)

- **Inspired, Not Copied**: The API design draws inspiration from well-established patterns in the PHP ecosystem, but every line of code is original
- **Clean Architecture**: Strict separation between Framework and Application layers
- **Zero Dependencies Core**: The framework core has minimal external dependencies
- **Modern PHP**: Built for PHP 8.1+ with full type safety and modern language features

Features
--------

[](#features)

### Core Components

[](#core-components)

- **Container** - PSR-11 compatible DI container with auto-wiring
- **Routing** - Fluent OOP router with middleware pipeline
- **HTTP** - Request/Response abstraction (PSR-7 inspired)
- **Events** - Priority-based event dispatcher (PSR-14 inspired)
- **Console** - CLI command framework with scheduling support
- **Bus** - Command/Query dispatcher with queue support
- **Database** - ORM, Query Builder, Migrations
- **Queue** - Async job processing (Database, Redis, Sync drivers)
- **Cache** - Multi-driver caching (File, Redis, Memory)
- **Auth** - Authentication &amp; Authorization (Session, Token, Gates, Policies)
- **Validation** - Form request validation with 70+ built-in rules
- **Logging** - PSR-3 logger with daily rotation
- **Realtime** - Broadcasting (Redis, RabbitMQ, Kafka brokers)
- **Search** - Elasticsearch integration
- **Concurrency** - Multi-process execution support

### Additional Features

[](#additional-features)

- Email with queue support
- Excel import/export (streaming, chunking)
- Task scheduling
- And more...

Optional Packages
-----------------

[](#optional-packages)

Toporia ecosystem includes optional packages for extended functionality:

PackageDescriptionInstall[toporia/mongodb](https://github.com/Minhphung7820/toporia-mongodb)MongoDB ODM with embedded documents, references, aggregation`composer require toporia/mongodb`[toporia/socialite](https://github.com/Minhphung7820/toporia-socialite)OAuth social authentication (Google, Facebook, GitHub)`composer require toporia/socialite`[toporia/webhook](https://github.com/Minhphung7820/toporia-webhook)Webhook dispatching and receiving`composer require toporia/webhook`[toporia/tenancy](https://github.com/Minhphung7820/toporia-tenancy)Multi-tenancy support`composer require toporia/tenancy`[toporia/audit](https://github.com/Minhphung7820/toporia-audit)Audit logging for models`composer require toporia/audit`[toporia/api-versioning](https://github.com/Minhphung7820/toporia-api-versioning)API versioning support`composer require toporia/api-versioning`After installing a package, register its service provider in your `AppServiceProvider`:

```
use Toporia\MongoDB\MongoDBServiceProvider;
use Toporia\Socialite\SocialiteServiceProvider;
use Toporia\Webhook\WebhookServiceProvider;

public function register(ContainerInterface $container): void
{
    $container->register(MongoDBServiceProvider::class);
    $container->register(SocialiteServiceProvider::class);
    $container->register(WebhookServiceProvider::class);
}
```

Publish package configs:

```
php console vendor:publish --tag=mongodb-config
php console vendor:publish --tag=socialite-config
php console vendor:publish --tag=webhook-config
```

Installation
------------

[](#installation)

```
composer require toporia/framework
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Composer

### Optional Extensions

[](#optional-extensions)

- `ext-redis` - Redis cache, queue drivers, and realtime broker
- `ext-mongodb` - Required for MongoDB package (`toporia/mongodb`)
- `ext-pdo_mysql` / `ext-pdo_pgsql` / `ext-pdo_sqlite` - Database support
- `ext-pcntl` - Multi-process execution (Linux/macOS only)

Quick Start
-----------

[](#quick-start)

```
