Skip to content

Introduction

Marko is a modular PHP 8.5+ framework that combines Magento’s powerful extensibility system with Laravel’s developer experience. It’s built on four core principles:

  1. Pragmatically opinionated — The right thing is easy, the wrong thing is annoying. Every “no” comes with a “yes, this way instead.”
  2. True modularity — Interface and implementation are split. Clean boundaries between packages. Everything is a module.
  3. Explicit over implicit — No magic methods, no hidden conventions. Everything is discoverable and type-safe.
  4. Loud errors — No silent failures. Every error tells you what went wrong, gives you context, and suggests a fix.
Magento's extensibility + Laravel's DX + Loud errors = Marko

From Magento, Marko takes the extensibility primitives: Preferences (interface swapping), Plugins (method interception), Events & Observers, and a layered module system.

From Laravel, Marko takes the developer experience: clean APIs, sensible defaults, Composer-native package management, and attribute-based routing.

From neither, Marko adds loud errors — a philosophy that every failure should help you fix it.

Everything in Marko is a module. A module is any Composer package with "extra": { "marko": { "module": true } } in its composer.json.

Modules live in three locations, resolved in priority order:

LocationPurposePriority
app/Your application customizationsHighest
modules/Manually installed third-party modulesMedium
vendor/Composer-installed packagesLowest

Higher-priority modules can override lower ones using Preferences, Plugins, and configuration merging.

Marko splits features into interface packages and implementation packages:

marko/cache → CacheInterface, CachePoolInterface (contracts)
marko/cache-file → FileCachePool (file-based implementation)
marko/cache-redis → RedisCachePool (Redis implementation)

You code against the interface. Swap implementations by changing a single binding — no other code changes needed.