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

ActiveLibrary[Framework](/categories/framework)

baremetalphp/framework
======================

A lightweight, educational PHP framework with service container, routing, ORM, and more

0.2.0(5mo ago)2251MITPHPPHP &gt;=8.2CI passing

Since Dec 6Pushed 5mo agoCompare

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

READMEChangelogDependencies (1)Versions (7)Used By (1)

Bare Metal PHP Framework
========================

[](#bare-metal-php-framework)

A lightweight, educational PHP framework with service container, routing, ORM, migrations, and more.

[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)[![PHP Version](https://camo.githubusercontent.com/4f0ff8d47b7c73441eb92a1f49af61c2d6521b14113c8fd85fac4416c863e7cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c7565)](https://camo.githubusercontent.com/4f0ff8d47b7c73441eb92a1f49af61c2d6521b14113c8fd85fac4416c863e7cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c7565)[![Packagist Version](https://camo.githubusercontent.com/1f3969d3afe6324d894dd6de966198a068425a922d8fbb86a62c145cd02185d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626172656d6574616c7068702f6672616d65776f726b)](https://camo.githubusercontent.com/1f3969d3afe6324d894dd6de966198a068425a922d8fbb86a62c145cd02185d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626172656d6574616c7068702f6672616d65776f726b)[![Downloads](https://camo.githubusercontent.com/57949ef5465a077e2ff1b023bf5894f7134c431dc63f3d8d741bdeb6d4065845/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626172656d6574616c7068702f6672616d65776f726b)](https://camo.githubusercontent.com/57949ef5465a077e2ff1b023bf5894f7134c431dc63f3d8d741bdeb6d4065845/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626172656d6574616c7068702f6672616d65776f726b)[![Stars](https://camo.githubusercontent.com/41ba39acdbcf62e545a22d46a47747b732c7bb69cd2a8239232b829036adfd73/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f626172656d6574616c7068702f6672616d65776f726b3f7374796c653d736f6369616c)](https://camo.githubusercontent.com/41ba39acdbcf62e545a22d46a47747b732c7bb69cd2a8239232b829036adfd73/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f626172656d6574616c7068702f6672616d65776f726b3f7374796c653d736f6369616c)[![Code Size](https://camo.githubusercontent.com/c4228760415ad3d182472eb4e9194cb051181fe73914591561c759c03d2c481e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f626172656d6574616c7068702f6672616d65776f726b)](https://camo.githubusercontent.com/c4228760415ad3d182472eb4e9194cb051181fe73914591561c759c03d2c481e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f626172656d6574616c7068702f6672616d65776f726b)

[![Inspired By Laravel](https://camo.githubusercontent.com/e151678b189375e2b4ecd2f61bf5f49461baf2abfb5fad3f66145134287cffa8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696e73706972656425323062792d4c61726176656c2d666632643230)](https://camo.githubusercontent.com/e151678b189375e2b4ecd2f61bf5f49461baf2abfb5fad3f66145134287cffa8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696e73706972656425323062792d4c61726176656c2d666632643230)[![Lightweight](https://camo.githubusercontent.com/659acf24cc3592144b9809e9dbf6d7e210842c947f04061a3b57e5a7efcce3ab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6672616d65776f726b2d6c696768747765696768742d73756363657373)](https://camo.githubusercontent.com/659acf24cc3592144b9809e9dbf6d7e210842c947f04061a3b57e5a7efcce3ab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6672616d65776f726b2d6c696768747765696768742d73756363657373)

Caution

This framework is *NOT PRODUCTION READY*. This is a limited feature framework intended as a learning tool/playground for developers.

Features
--------

[](#features)

- 🎯 **Service Container** - Dependency injection and service management
- 🛣️ **Routing** - Clean, simple routing with middleware support
- 🗄️ **ORM** - Active Record style ORM with relationships (hasOne, hasMany, belongsTo, belongsToMany)
- 📊 **Migrations** - Database version control and schema management
- 🎨 **Views** - Simple templating engine with blade-like syntax
- 🔐 **Authentication** - Built-in authentication helpers
- 🧪 **Testing** - PHPUnit test suite included
- ⚡ **CLI Tools** - Built-in console commands for common tasks

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

[](#requirements)

- PHP 8.0+
- PDO extension
- SQLite, MySQL, or PostgreSQL support

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

[](#quick-start)

### Creating a New Project

[](#creating-a-new-project)

The easiest way to get started is to use the project skeleton:

```
composer create-project baremetalphp/baremetalphp [your-project]

cd [your-project]

php mini migrate
php mini serve
```

> Note: The framework defaults to a SQLite database, but you can set up a MySQL connection in `.env` (PostgreSQL is ~95% functional but not fully tested).

### Manual Setup

[](#manual-setup)

1. **Require the framework**:

```
composer require elliotanderson/phpframework
```

2. **Set up your application structure**:

```
my-app/
├── app/
│   ├── Http/
│   │   └── Controllers/
│   └── Models/
├── bootstrap/
│   └── app.php
├── config/
│   └── database.php
├── public/
│   └── index.php
├── routes/
│   └── web.php
└── composer.json

```

3. **Create a route** (`routes/web.php`):

```
use BareMetalPHP\Routing\Router;
use BareMetalPHP\Http\Response;

return function (Router $router): void {
    $router->get('/', function () {
        return new Response('Hello, World!');
    });
};
```

4. **Bootstrap your application** (`bootstrap/app.php`):

```
