Usage

TetherPHP is designed to be straightforward to use, with minimal dependencies.

Getting Started

The recommended way to create a new project is with Composer:

composer create-project dillonsmart/tetherphp my-project

Alternatively, clone the repository directly:

git clone https://github.com/Dillonsmart/tetherphp.git my-project

Configuration

Copy the environment file and set your application name:

cp .env.example .env

The .env file contains APP_NAME and APP_DEBUG. No database or API keys required to get started.

Installing Dependencies

Generate the Composer autoload file:

composer install

TetherPHP has zero package dependencies. Composer is only used for autoloading.

The Console

Every generator and maintenance task runs through tether in your project root:

php tether help

Fourteen commands ship with the framework — generators, and the introspection commands that make it explain your application back to you.

The console itself ships with the framework. Composer installs it as vendor/bin/tether, and the tether file in your project is a two-line shim that forwards to it — so php vendor/bin/tether help is the same program, and your application never carries a copy of the console that can drift from the framework’s.

Clearing Boilerplate

The skeleton ships with a home page to get you started. To remove it and start from scratch:

php tether boilerplate:clear

This removes the default Action, Domain, Responder, and View — giving you a blank canvas.

Creating Features

Use the CLI to scaffold a new ADR feature:

php tether make:feature Blog

Every feature is a directory, so this creates app/Actions/Blog/Index.php, app/Domains/Blog/Index.php, app/Domains/Blog/Results/Page.php, app/Responders/Blog/Index.php and the view they render — wired together and ready to use. The result class is the value the Domain returns; see What is ADR?.

A feature grows by addition. To give Blog a second page, name the feature and the operation:

php tether make:action Blog Show
php tether make:domain Blog Show
php tether make:responder Blog Show

The new files land beside the ones already there and nothing moves. For a whole CRUD resource in one command, see CRUD; for everything else the console does, see The console.