Download the PHP package mrldavies/wp-rest-fluent without Composer

On this page you can find all versions of the php package mrldavies/wp-rest-fluent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-rest-fluent

wp-rest-fluent

A fluent routing layer for the WordPress REST API with middleware, groups and response formatting.

Inspired by Laravel-style routing and middleware patterns, adapted for WordPress.


Requirements

If using Roots Sage, v10 or above is required.


Installation

Install via Composer:


Basic Usage

Import the class:

Define your routes:

Register routes during boot:


Using with Roots Sage (v10+)

If using Roots Sage v10 or above (Acorn-based), register routes inside a service provider.

Example:

Ensure your provider is registered in config/app.php.

This works because Acorn bootstraps WordPress hooks correctly within the container lifecycle.


HTTP Methods


Route Parameters

You can define typed parameters using curly braces:

Supported built-in types

Example:

Optional parameter:


Advanced / Raw Regex Routes

If you require full regex control, you can bypass the curly-brace syntax entirely and use native WordPress-style patterns:

This gives complete control over route matching.


Response Handling

Your handler may return:

Array

Object

Returning WP Native Responses

You may also return:

These will be passed through untouched.


Formatter

Enable formatted responses:

Output shape:


Mapping Custom Response Shapes

If your handler returns a different structure:

Map it:


Middleware

Attach middleware to routes:

Middleware follows the same conceptual structure as Laravel middleware.

Laravel middleware documentation: https://laravel.com/docs/middleware

Your middleware must implement:

To continue the chain:

Middleware may return:

Middleware execution order is LIFO (last attached runs closest to the handler).


Shipped Middleware

RateLimitMiddleware

The package includes a simple transient-based rate limiter.

Example:

Features:

The rate limiter is provided as a convenience and can be replaced or extended.


Route Groups

Group routes under shared configuration:

You may also group middleware and permissions:


Permissions

Attach permission callbacks:

Permission callbacks must return:


Custom Namespace Prefix

Default namespace prefix is v1.

Override per-route:


Debugging Routes

Inspect registered routes:


Notes


License

MIT


All versions of wp-rest-fluent with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mrldavies/wp-rest-fluent contains the following files

Loading the files please wait ...