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

Choose your starting point

Perfect for: Starting from scratch, learning the basics, or building your own structure.

Create a new project

composer create-project larafony/empty-project my-app

Navigate to your project

cd my-app

Start the development server

composer serve
Done! Visit localhost:8000 to see the welcome page. Start building!
What's included:
  • One simple controller + Blade view
  • Layout component ready to use
  • Database support (commented out, easy to enable)
  • CLAUDE.md for AI-assisted development
Perfect for: Exploring all features, learning best practices, or using as a reference.

Create a new project

composer create-project larafony/skeleton 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

composer serve
Done! Visit localhost:8000/notes for Blade templates and localhost:8000/inertia/notes for Inertia.js.
What's included:
  • Full ORM with relationships (belongsTo, hasMany, belongsToMany)
  • Blade templates + Inertia.js/Vue examples
  • Authentication, sessions, DTOs with validation
  • Migrations, seeders, console commands
Requirements: PHP ≥ 8.5, Composer 2.9+, Node.js ≥ 22 (for full-feature demo), 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.

Want to understand your users?

Record user sessions and see exactly how they interact with your app.

Try Record-it