PHPackages                             gortonsd/marshal - 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. gortonsd/marshal

ActiveLibrary[Framework](/categories/framework)

gortonsd/marshal
================

A lightweight PHP framework with automatic controller discovery, route registration via docblock annotations, and intelligent route caching

03PHP

Since Aug 22Pushed 10mo agoCompare

[ Source](https://github.com/gortonsd/marshal)[ Packagist](https://packagist.org/packages/gortonsd/marshal)[ RSS](/packages/gortonsd-marshal/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

gortonsd/Marshal
================

[](#gortonsdmarshal)

Marshal is a lightweight PHP framework designed to make building web applications simple and intuitive. With Marshal, you can focus on your application's logic while the framework handles routing, controller discovery, and more.

Key Features
------------

[](#key-features)

- **Attribute-Based Routing**: Define your routes using PHP attributes. Simply add a `#[RouteAttribute(url: '/your-url')]` attribute to your controller class and Marshal will automatically register the route.
- **Simple Controller Inheritance**: Extend `gortonsd\Marshal\Controller` to create your own controllers. Marshal takes care of all the heavy lifting, so you only need to implement your HTTP methods (`get()`, `post()`, etc.).
- **Automatic Controller Discovery**: Marshal scans your controllers folder and registers routes automatically, keeping your codebase clean and organized.
- **Ready for Expansion**: The framework is designed to be extended, with plans for request/response helpers, middleware, and more.

Getting Started
---------------

[](#getting-started)

1. **Install Marshal** (coming soon via Composer)
2. **Create a Controller**

```
use gortonsd\Marshal\RouteAttribute;
use gortonsd\Marshal\Controller;

#[RouteAttribute(url: '/example')]

class ExampleController extends Controller {
	public function get() {
		echo "Hello from ExampleController!";
	}
}
```

> **Note:** Controllers can also specify optional `name` and `middleware` parameters in the `RouteAttributes` attribute for advanced routing and access control.

3. **Run Marshal**

```
use gortonsd\Marshal\Router;

$controllersPath = __DIR__ . '/Controllers'; // Path to your controllers
$router = new Router($controllersPath); // Uses cache if available
// $router = new Router($controllersPath, true); // Force refresh and rebuild route cache
$router->run();
```

### Route Cache Behavior

[](#route-cache-behavior)

- Marshal caches discovered routes in a JSON file for fast startup.
- By default, the cache is used if available. To force a refresh (e.g., after adding new controllers), pass `true` as the second argument to the `Router` constructor.
- Example: `$router = new Router($controllersPath, true);`
- Cache will be built if it does not already exist

Philosophy
----------

[](#philosophy)

Marshal aims to provide a modern, minimal, and developer-friendly experience for PHP web development. By leveraging PHP attributes and convention over configuration, Marshal lets you build robust applications with less boilerplate.

---

*Marshal: The simple way to marshal your web requests.*

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/133211967?v=4)[Gorton Software Development](/maintainers/gortonsd)[@gortonsd](https://github.com/gortonsd)

---

Top Contributors

[![gortonsd](https://avatars.githubusercontent.com/u/133211967?v=4)](https://github.com/gortonsd "gortonsd (24 commits)")

### Embed Badge

![Health badge](/badges/gortonsd-marshal/health.svg)

```
[![Health](https://phpackages.com/badges/gortonsd-marshal/health.svg)](https://phpackages.com/packages/gortonsd-marshal)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M299](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
