Larafony Framework Logo

Larafony Framework

Modern PHP 8.5 framework — built for clarity, not complexity.

Key Features

Everything you need to build modern PHP applications

PSR-Compliant

Built on PSR-7 (HTTP), PSR-11 (Container), PSR-15 (Middleware), and PSR-3 (Logger). Full interoperability with any PSR-compliant library.

Type-Safe DTOs

Leverage PHP 8.5 property hooks and attributes for automatic validation. Type-safe data transfer with asymmetric visibility.

Blade Templates

Powerful, elegant templating engine with components, slots, and custom directives. Write clean, maintainable views.

Attribute Routing

Define routes with PHP attributes directly on controllers. No configuration files, just clean, self-documenting code.

Active Record ORM

Thanks to PHP 8.4+ property hooks, it was finally possible to create ORM in PHP behaving like Entity Framework from C#. Relationships, query builder, migrations, and seeders included.

PHP 8.5 Pipes

Clean data transformation pipelines using the pipe operator. Transform data with readable, functional code.

Queue & Jobs

ORM-based job queue with UUID support, Clock integration, and cron scheduling. Process background tasks with database or Redis backends.

Event System (PSR-14)

Event dispatcher with listener priority, stoppable propagation, and full PSR-14 compliance. Decouple your application logic with events.

Cache (PSR-6)

Multi-backend caching with Redis, Memcached, and file storage. Authorization-aware cache for role-based content.

Authorization (RBAC)

Built-in role and permission system with policy classes. Fine-grained access control without external packages.

Encryption

Modern libsodium XChaCha20-Poly1305 AEAD encryption. Secure sessions, cookies, and sensitive data by default.

Sessions & Cookies

Encrypted session management with file and database drivers. Secure, tamper-proof cookies out of the box.

Mail

Native SMTP implementation with Mailable classes. Send emails without external dependencies.

Debug Toolbar

Professional debug bar with query monitoring, N+1 detection, and performance metrics. Automatic eager loading optimization.

Error Handling

Beautiful debug views for web and interactive REPL-like debugging in console. The only PHP framework with built-from-scratch CLI debugging.

Console Commands

Artisan-like CLI with migrations, seeders, queue workers, and interactive debugging in terminal. Beautiful console output and progress bars.

HTTP Client (PSR-18)

Make HTTP requests to external APIs with PSR-18 compliant client. Clean, fluent interface for API integrations.

Inertia.js Support

Build modern SPAs with Vue.js using server-side routing. No separate API needed, full framework integration.

Clock System (PSR-20)

PSR-20 compliant clock for testable time operations. Freeze time in tests, no more DateTimeImmutable headaches.

Logging (PSR-3)

PSR-3 compliant logging with multiple channels and handlers. Track application events with ease.

Getting Started

Up and running in seconds

Create a new project

composer create-project larafony/skeleton:dev-main my-app

Navigate to your project

cd my-app

Install frontend dependencies (Inertia.js + Vue)

npm install

Build frontend assets

npm run build

Run the installer (database setup + demo data)

php bin/larafony build:notes

Start the development server

php8.5 -S localhost:8000 -t public
Done! Visit localhost:8000/notes to see the demo app with Blade templates and localhost:8000/inertia/notes for the Inertia.js version.
Optional - Redis/Memcached Cache:
As of Nov. 22, 2025, there is no php8.5-memcached packages available.

Temporary solution: Run ./build.sh from project root to compile extensions from source.

For Redis: Simply run:
  • Debian/Ubuntu: sudo apt install php8.5-redis
  • RHEL/Fedora: sudo dnf install php-redis (via Remi repository)
  • Windows: Use WSL2 with Ubuntu 😎 (or hope XAMPP/WAMPP adds latest PHP with cache drivers)
FileStorage cache works out of the box, no setup required.
Requirements: PHP ≥ 8.5, Composer, Node.js ≥ 22, MySQL/PostgreSQL/SQLite
Composer v2.9 Required: Larafony & PHP 8.5 require Composer v2.9+. If you get any deprecation warnings, simply run composer self-update.
PS: Composer 2.9 can automatically not install vulnerable packages and automatically resolve conflicts in lock file, so it's highly recommended to update your Composer instance.

Philosophy

The framework you can truly understand

"The best framework is the one you can replace piece by piece — because you understand it completely."
Production-Ready from Day One

Not a toy or tutorial framework. Built for real-world applications with high quality standards and full test coverage.

Framework-Agnostic Mindset

Use Blade, Twig, or Inertia.js. Swap components freely. No vendor lock-in, just pure PHP flexibility.

Performance-First Architecture

Minimal dependencies, optimized pipelines, and efficient patterns. Fast by design, not by accident.

Readable, Modern PHP Code

Clean architecture, SOLID principles, and PHP 8.5 features. Code you'll be proud to maintain.