🚀 Version 1.0.0 Now Available

The Modern PHP
Framework

Build blazing fast web applications with Next.js inspired file-based routing, powerful validation, and Laravel-like elegance - all in pure PHP

30+
Validation Rules
Zero
Config Required
100%
PHP Native
Features

Everything You Need

Packed with features to help you build modern web applications faster

📁

File-based Routing

Next.js style routing. Create pages by adding files - no configuration needed

🔧

RESTful API Routes

Build APIs with class-based handlers. GET, POST, PUT, PATCH, DELETE support

Advanced Validation

30+ rules: required, email, regex, file uploads, conditional validation, and more

📤

File Upload System

Secure uploads with public/private storage, validation, and automatic path handling

🐛

Error Boundary

Beautiful error pages with stack traces, code preview, and error navigation

📝

Console Logging

Debug with console_info(), console_error(), console_debug() and more

🎨

SEO Metadata

Built-in metadata system with Open Graph and Twitter Card support

🔒

Middleware

Route-level middleware for auth, CORS, rate limiting, and security

CLI Commands

Generate routes, models, migrations with powerful CLI tools

🗂️

Layout System

Hierarchical layouts with automatic content wrapping and metadata merging

🔄

Request/Response

Modern classes for handling HTTP requests, JSON, redirects, and files

🌐

Environment Config

.env file support for database, debug mode, and app configuration

🎯

Dynamic Routes

Support for [id], [slug] parameters with automatic route matching

🚀

Zero Config

Works immediately with sensible defaults. No complex setup required

📦

DI Container

Dependency injection with service container for clean architecture

🛠️

Template Directives

Optional Blade-like syntax support for @if, @foreach, @include directives (use plain PHP if preferred)

💾

Database Layer

Query builder with support for MySQL, PostgreSQL, and MongoDB

🔐

Security Features

CSRF protection, XSS prevention, secure headers, and input sanitization

📊

Form Handling

Easy form creation, validation, and processing with helper functions

🎭

Model System

Eloquent-inspired models with relationships and query scopes

Simple. Powerful. Elegant.

Create a complete API endpoint in seconds with clean, readable code that just works.

// app/api/users/route.apna.php
namespace App\Api\Users;

class UsersHandler {
  public function GET($request) {
    return Response::json([
      'users' => User::all()
    ]);
  }
}
Quick Start

Get Started in Minutes

Follow these simple steps to start building with ApnaPHP

1

Install Dependencies

Install the framework using Composer

composer install
2

Create Your First Route

Generate a new page or API endpoint

php apna make:route about
3

Start Development Server

Run the built-in ApnaPHP server

php apna serve

🎉 That's it! You're ready to build

Your application is now running at http://localhost:3000

Explore Full Documentation
Comparison

Why Choose ApnaPHP?

See how ApnaPHP compares to traditional PHP frameworks

Traditional Frameworks

Complex setup and configuration

Complex routing configuration
Heavy dependencies
Steep learning curve
Boilerplate code