PHPackages                             bowphp/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. bowphp/framework

ActiveLibrary[Framework](/categories/framework)

bowphp/framework
================

The bow PHP Framework

5.4.10(1w ago)6017.5k↑541.7%18[1 issues](https://github.com/bowphp/framework/issues)9MITPHPPHP ^8.1CI passing

Since Oct 16Pushed 2w ago4 watchersCompare

[ Source](https://github.com/bowphp/framework)[ Packagist](https://packagist.org/packages/bowphp/framework)[ Fund](https://www.buymeacoffee.com/iOLqZ3h)[ GitHub Sponsors](https://github.com/papac)[ RSS](/packages/bowphp-framework/feed)WikiDiscussions 5.x Synced today

READMEChangelog (10)Dependencies (105)Versions (110)Used By (9)

Bow Framework
=============

[](#bow-framework)

[![docs](https://camo.githubusercontent.com/b94553a577ad040c07545f85231121534da3cd2c832358da04aa3bd99d6015b6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d72656164253230646f63732d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/bowphp/docs)[![version](https://camo.githubusercontent.com/c7e6220f3ca5f418d9a808dd07f0a1caf56538e2a6457769495949e787dd2d9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626f777068702f6672616d65776f726b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bowphp/framework)[![license](https://camo.githubusercontent.com/16fd53dfb23034ce091869a85df4402aa14e64f35adf8deb8547c6356766aa28/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626f777068702f6672616d65776f726b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/bowphp/framework/blob/main/LICENSE)[![Build Status](https://github.com/bowphp/framework/actions/workflows/tests.yml/badge.svg)](https://github.com/bowphp/framework/actions/workflows/tests.yml/badge.svg)

> A lightweight, modern PHP framework designed for building web applications with clean architecture and modular design.

To use this package, please create an application from this package [bowphp/app](https://github.com/bowphp/app)

Overview
--------

[](#overview)

Bow Framework is a lightweight PHP framework created by Franck DAKIA that emphasizes simplicity, performance, and developer experience. It provides a comprehensive set of tools for building modern web applications with clean, maintainable code.

**Requirements:**

- PHP ^8.1+
- Composer
- Extensions: ext-ftp, ext-openssl, ext-pcntl, ext-readline, ext-pdo

**Key Highlights:**

- Modern PHP 8.1+ features (union types, attributes, named arguments)
- Modular architecture with 20+ independent components
- Lightweight and fast with minimal dependencies
- Full-stack framework with everything you need
- Well-tested: 1,600+ tests, 3,300+ assertions, zero logical failures
- Active development with regular updates

Core Features
-------------

[](#core-features)

### Database &amp; ORM

[](#database--orm)

- **Barry ORM**: Lightweight ActiveRecord-style ORM
- **Query Builder**: Fluent, expressive database queries
- **Multi-database**: MySQL, PostgreSQL, SQLite support
- **Migrations**: Version control for database schema
- **Relationships**: HasOne, HasMany, BelongsTo, BelongsToMany
- **Soft delete**: `SoftDelete` trait with `delete`/`restore`/`forceDelete` and `withTrashed`/`onlyTrashed` query scopes
- **Pagination**: Built-in pagination support

### Routing System

[](#routing-system)

- Simple, expressive routing syntax (`$app->get`, `$app->post`, ...)
- **PHP 8 attribute routing**: `#[Controller]`, `#[Get]`, `#[Post]`, `#[Put]`, `#[Patch]`, `#[Delete]`, `#[Options]`, `#[Route]`
- RESTful resource routing with automatic CRUD operations
- Route naming for easy URL generation
- Route parameters with regex constraints
- Middleware support per route or route group, with `name:arg` parameter syntax
- Route prefix and domain grouping
- Custom HTTP error handlers via `code()`

### Mail System

[](#mail-system)

- Multiple adapters: SMTP, AWS SES, Native PHP mail
- RFC-compliant SMTP implementation
- Email parsing with "Name " format support
- File attachments
- Queue integration for asynchronous sending

### Queue System

[](#queue-system)

- Multiple backends: Beanstalkd, Redis, SQS, Database, Sync
- Object-oriented job definitions
- Event-driven job queuing
- Automatic retry logic with exponential backoff
- Mail queue support

### Storage System

[](#storage-system)

- Multi-driver: Local, FTP, AWS S3
- Dynamic storage adapter selection
- File operations: upload, download, copy, move, delete
- Directory management
- Efficient stream handling for large files

### Security Features

[](#security-features)

- XSS protection with automatic filtering
- CSRF token-based validation
- Data encryption utilities
- Password hashing (Bcrypt/Argon2)
- Native authentication system with guards

### Additional Features

[](#additional-features)

- **Cache**: Filesystem, Redis, Database caching
- **Events**: Event management and dispatching
- **Session**: User session management
- **Validation**: Comprehensive form and data validation
- **Console**: CLI commands and generators
- **Testing**: PHPUnit integration with test utilities
- **Translation**: Internationalization support
- **View Rendering**: Tintin template engine integration
- **Middleware**: HTTP middleware stack
- **Container**: Dependency injection with auto-resolution

Architecture
------------

[](#architecture)

### Request Lifecycle

[](#request-lifecycle)

 ```
flowchart LR
    Client --> Request
    Request --> Kernel
    Kernel --> Router
    Router --> Middleware
    Middleware --> Controller
    Controller --> Model[ModelBarry ORM]
    Model --> Database
    Database --> View
    Database --> Response
    View --> Response
    Response --> Client
```

      Loading 1. **Request arrives** at entry point
2. **Kernel loads** configurations from `config/`
3. **Router matches** URL to controller/action
4. **Middleware processes** request (auth, validation, etc.)
5. **Controller executes** business logic
6. **Model interacts** with database
7. **View renders** response (HTML/JSON)
8. **Response sent** back to client

### Design Patterns

[](#design-patterns)

The framework implements several design patterns:

- **Singleton**: Application, Configuration loaders
- **Factory**: Database connections, Mail adapters
- **Strategy**: Storage drivers, Queue backends
- **Observer**: Event system
- **Middleware Pattern**: HTTP request pipeline
- **Repository Pattern**: Database abstraction
- **Service Container**: Dependency injection
- **Facade Pattern**: Helper functions

Project Structure
-----------------

[](#project-structure)

The project is organized into the following directories, each representing an independent module:

- **src/**: Source code for the Bow Framework.
    - **Application/**: Main application logic and configuration.
    - **Auth/**: Authentication and authorization management.
    - **Cache/**: Caching mechanisms.
    - **Configuration/**: Configuration settings management.
    - **Console/**: Console commands and utilities.
    - **Container/**: Dependency injection and service container.
    - **Contracts/**: Interfaces and contracts for various components.
    - **Database/**: Database connections and ORM.
    - **Event/**: Event management and dispatching.
    - **Http/**: HTTP requests and responses management.
    - **Mail/**: Email sending and configuration.
    - **Notifier/**: Notifications.
    - **Middleware/**: Middleware classes for request handling.
    - **Queue/**: Job queues and background processing.
    - **Router/**: HTTP request routing.
    - **Security/**: Security features like encryption and hashing.
    - **Session/**: User session management.
    - **Storage/**: File storage and retrieval.
    - **Support/**: Utility classes and helper functions.
    - **Testing/**: Unit testing classes and utilities.
    - **Translate/**: Translation and localization.
    - **Validation/**: Data validation.
    - **View/**: View rendering and templating.
- **tests/**: Unit tests for the project.

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

[](#quick-start)

### Installation

[](#installation)

```
# Create a new Bow application
composer create-project bowphp/app my-app

# Navigate to the project
cd my-app

# Start the development server
php bow serve
```

### Basic Usage

[](#basic-usage)

**Define Routes:**

```
// routes/app.php
$app->get('/', function () {
    return 'Hello World!';
});

$app->get('/users/:id', function ($id) {
    return "User ID: $id";
});

// RESTful resource routing
$app->rest('/api/posts', 'PostController');

// Attribute-based controllers (no central route file required)
$app->register(\App\Controllers\PostController::class);
```

**Create a Controller:**

```
namespace App\Controllers;

use Bow\Http\Request;
use App\Models\Post;

class PostController
{
    public function index()
    {
        return Post::all();
    }

    public function store(Request $request)
    {
        $post = Post::create($request->all());
        $post->persist();

        return $post;
    }
}
```

**Work with Database:**

```
use App\Models\User;
use Bow\Database\Database;

// Using Barry ORM
$user = User::retrieve(1);
$users = User::where('active', true)->get();

// Using the Query Builder
$users = Database::table('users')
    ->where('role', 'admin')
    ->orderBy('created_at', 'desc')
    ->paginate(10);
```

Code Quality &amp; Testing
--------------------------

[](#code-quality--testing)

### Current Status

[](#current-status)

- **Test Suite**: 1,600+ tests with 3,300+ assertions
- **Logical failures**: 0 — the only remaining errors require external services (FTP server, S3 endpoint) and are skipped by default
- **Code Style**: PSR-12 (`composer phpcs` to check, `composer phpcbf` to fix)
- **Static analysis**: PHPStan in `require-dev` (`vendor/bin/phpstan analyse src`)
- **PHP Version**: 8.1+ with modern features

### Recent Improvements

[](#recent-improvements)

- **SMTP Adapter**: Complete rewrite (8 → 21 methods, RFC-compliant)
- **FTP Service**: Enhanced with retry logic and better error handling
- **Queue System**: Graceful logger fallback
- **Attribute routing**: PHP 8 `#[Controller]` / `#[Get]` / `#[Post]` / ... wiring via `$app->register(...)`
- **Barry soft delete**: trait + query scopes (`withTrashed`, `onlyTrashed`, `withoutTrashed`)
- **Router**: instance-level route storage (no more cross-test leakage)
- **PHP 8.x**: Modernized code style (arrow functions, union types)

See [CHANGELOG.md](CHANGELOG.md) for full details.

Use Cases
---------

[](#use-cases)

**Ideal For:**

- REST APIs and microservices
- Web applications with complex database requirements
- Applications requiring file storage (S3, FTP)
- Projects needing queue/job processing
- Multi-tenant applications
- Internationalized applications

Ecosystem
---------

[](#ecosystem)

The Bow ecosystem includes several packages:

- **[bowphp/app](https://github.com/bowphp/app)**: Application skeleton
- **[bowphp/tintin](https://github.com/bowphp/tintin)**: Template engine
- **[bowphp/policier](https://github.com/bowphp/policier)**: Authentication &amp; authorization
- **[bowphp/payment](https://github.com/bowphp/payment)**: Payment gateway integration

Contributing
------------

[](#contributing)

Thank you for considering contributing to Bow Framework! The contribution guide is in the framework documentation.

- [Franck DAKIA](https://github.com/papac)
- [Thank's collaborators](https://github.com/bowphp/framework/graphs/contributors)

### Contribution Guidelines

[](#contribution-guidelines)

We welcome contributions from the community! To contribute to the project, please follow these steps:

1. Fork the project and clone it to your local machine.
2. Create a new branch for your changes.
3. Make your changes and commit them.
4. Push your changes to your fork and create a pull request.

For more detailed information, refer to the `CONTRIBUTING.md` file.

Documentation
-------------

[](#documentation)

- [Official Documentation](https://bowphp.com)
- [API Reference](https://bowphp.com/api)
- [Tutorials &amp; Guides](https://bowphp.com/docs)

Support &amp; Community
-----------------------

[](#support--community)

### Get Help

[](#get-help)

- **Documentation**:
- **Issues**: [GitHub Issues](https://github.com/bowphp/framework/issues)
- **Discussions**: [GitHub Discussions](https://github.com/bowphp/framework/discussions)

### Stay Updated

[](#stay-updated)

- **Twitter**: [@papacdev](https://twitter.com/papacdev)
- **GitHub**: [bowphp](https://github.com/bowphp)

License
-------

[](#license)

The Bow Framework is open-source software licensed under the [MIT license](LICENSE).

Contact
-------

[](#contact)

- Email:
- Twitter: [@papacdev](https://twitter.com/papacdev)

For bug reports, please use [GitHub Issues](https://github.com/bowphp/framework/issues).

---

**Made with love by the Bow Framework Team**

###  Health Score

67

—

FairBetter than 99% of packages

Maintenance96

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community30

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~3 days

Total

105

Last Release

12d ago

Major Versions

3.x-dev → 4.0.02019-04-18

4.x-dev → 5.0-rc2023-04-11

PHP version history (5 changes)3.0.0PHP &gt;=7

4.0.5PHP ^7.1

4.3.83PHP ^7.2

4.4.0PHP ^7.2|^8.0

5.0-rcPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/96099e66c63e31445f3f76a12e94104030f504eeb18f007216bb4ebdcdeadf7f?d=identicon)[papac](/maintainers/papac)

---

Top Contributors

[![papac](https://avatars.githubusercontent.com/u/9353811?v=4)](https://github.com/papac "papac (2376 commits)")[![detygon](https://avatars.githubusercontent.com/u/25983025?v=4)](https://github.com/detygon "detygon (45 commits)")[![gessyken](https://avatars.githubusercontent.com/u/129058258?v=4)](https://github.com/gessyken "gessyken (11 commits)")[![houssenedao](https://avatars.githubusercontent.com/u/16049399?v=4)](https://github.com/houssenedao "houssenedao (4 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")[![SergeTouvoli](https://avatars.githubusercontent.com/u/82214916?v=4)](https://github.com/SergeTouvoli "SergeTouvoli (1 commits)")[![juvpengele](https://avatars.githubusercontent.com/u/30692796?v=4)](https://github.com/juvpengele "juvpengele (1 commits)")[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (1 commits)")

---

Tags

bowframeworkphpphp-frameworkframeworkbow

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bowphp-framework/health.svg)

```
[![Health](https://phpackages.com/badges/bowphp-framework/health.svg)](https://phpackages.com/packages/bowphp-framework)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[laravel/nightwatch

The official Laravel Nightwatch package.

36210.1M36](/packages/laravel-nightwatch)[alleyinteractive/mantle-framework

A framework for powerful WordPress development

28325.2k2](/packages/alleyinteractive-mantle-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
