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 9mo agoCompare

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

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 5% of packages

Maintenance42

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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://www.gravatar.com/avatar/06097c6331cdec0a85129b866f47e82de3ddf1e84b949378f77a09a76a41d8eb?d=identicon)[gortonsd](/maintainers/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/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

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

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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