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

ActiveProject[Framework](/categories/framework)

axionphp/framework
==================

AxionPHP - A Lightweight PHP Micro Framework with JWT API Support

00PHP

Since Aug 7Pushed 9mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

AxionPHP — A Lightweight PHP Micro Framework with JWT API Support
=================================================================

[](#axionphp--a-lightweight-php-micro-framework-with-jwt-api-support)

[![PHP Version](https://camo.githubusercontent.com/2f6f9af2e917cbf5786673e8e4ed8d0d9b29be6131327a992063e69136a93411/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c7565)](https://camo.githubusercontent.com/2f6f9af2e917cbf5786673e8e4ed8d0d9b29be6131327a992063e69136a93411/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e302532422d626c7565)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)[![Framework](https://camo.githubusercontent.com/26f49f5de7df5a15cf3304720572ba1113dada99b84afaa0e70477291a06084c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4672616d65776f726b2d4178696f6e5048502d6f72616e6765)](https://camo.githubusercontent.com/26f49f5de7df5a15cf3304720572ba1113dada99b84afaa0e70477291a06084c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4672616d65776f726b2d4178696f6e5048502d6f72616e6765)

AxionPHP is a lightweight, high-performance PHP micro-framework built using Symfony Components and powered by Laravel's Eloquent ORM. Inspired by Express.js and designed for modern API development, AxionPHP is fully customizable and extensible — making it perfect for building RESTful APIs and web applications.

🎯 Key Features
--------------

[](#-key-features)

### ⚙️ Core Architecture

[](#️-core-architecture)

- **Symfony Components**: Built on Symfony Routing, HTTP Foundation, Dotenv, and Event Dispatcher
- **PSR-4 Compliant**: Fully Composer-based with PSR-4 autoloading
- **Modular Structure**: Clean, modular, and scalable architecture

### 🧠 Developer Experience

[](#-developer-experience)

- **Environment Configuration**: `.env` based configuration for different environments
- **Debug Mode**: Developer-friendly error handling with detailed stack traces
- **Simple Structure**: Easy to understand and extend

### 🔄 Routing &amp; Middleware

[](#-routing--middleware)

- **RESTful Routing**: Symfony Router-based routing system
- **Middleware Pipeline**: Request/response lifecycle management
- **Route Grouping**: Support for route prefixes and middleware groups
- **Resource Routes**: Automatic CRUD route generation

### 🛢️ ORM &amp; Database

[](#️-orm--database)

- **Laravel Eloquent**: Elegant database interaction with Eloquent ORM
- **Multiple Databases**: Support for MySQL, SQLite, PostgreSQL
- **Laravel-like Migrations**: Full migration system with CLI commands
- **Schema Builder**: Powerful database schema management

### 🔐 JWT Authentication

[](#-jwt-authentication)

- **Built-in JWT**: Complete JWT implementation using firebase/php-jwt
- **Secure Endpoints**: Login, logout, profile, and refresh token endpoints
- **Middleware Protection**: JWT middleware for protected routes
- **Token Management**: Token verification, expiration, and refresh handling

### 📦 API-Ready

[](#-api-ready)

- **JSON Responses**: Consistent JSON API response format
- **Status Codes**: Proper HTTP status code handling
- **CORS Support**: Built-in CORS headers for API consumption

🚀 Quick Start
-------------

[](#-quick-start)

### Installation

[](#installation)

1. **Clone or create your project:**

```
git clone  axionphp-app
cd axionphp-app
```

2. **Install dependencies:**

```
composer install
```

3. **Configure environment:**

```
cp .env .env.local
# Edit .env.local with your database credentials
```

4. **Start development server:**

```
# Using AxionPHP CLI (recommended)
php axion start
# or
php axion start:dev

# Using Composer scripts
composer start
# or
composer serve

# Manual PHP server
php -S localhost:8000 -t public
```

### Basic Usage

[](#basic-usage)

#### 1. Define Routes

[](#1-define-routes)

```
// routes/web.php
$router = app()->getRouter();

$router->get('/', 'App\Controllers\HomeController::index');
$router->post('/users', 'App\Controllers\UserController::store');
```

#### 2. Create Controllers

[](#2-create-controllers)

```
// app/Controllers/UserController.php
