~/docs
Resonate
Resonate
13.x 13.43.0.3, current
Fledge
Toggle sidebar
Fledge
webpatser/fledge-framework 13.43.0.3

Fledge 13.x

Installation

Start a new application from the Fledge skeleton and verify that it runs Fledge.

The skeleton webpatser/fledge is a Laravel 13 application that uses webpatser/fledge-framework instead of laravel/framework. It is currently distributed through Git and is not on Packagist, so composer create-project is not available yet. Clone it instead.

Requirements

  • PHP 8.6
  • The intl extension, recommended; without it IDN hosts are not converted to punycode and are rejected, and SORT_LOCALE_STRING sorting compares byte-wise
  • Composer 2.x

Create the application

git clone https://github.com/webpatser/fledge my-app
cd my-app
composer install
cp .env.example .env
php artisan key:generate
php artisan serve

The skeleton's composer.json also defines a setup script that installs dependencies, copies .env.example, generates the key, runs migrations and builds the assets:

composer setup

Verify the install

The framework ships a script that checks whether Fledge or stock Laravel is installed:

bash vendor/webpatser/fledge-framework/bin/verify-fledge-install.sh

On Fledge it prints a line like this and exits with 0:

OK running Fledge framework v13.43.0.3

If vendor/laravel/framework is present instead, it warns that you are not running Fledge and exits with 1. It exits with 2 when there is no vendor/ directory or neither framework package is found.

What the skeleton configures

The skeleton is a standard Laravel 13 layout with a few Fledge defaults:

  • REDIS_CLIENT=fledge in .env.example, and fledge as the fallback in config/database.php. See Redis client.
  • Preconfigured fledge-mysql, fledge-mariadb and fledge-pgsql connections in config/database.php. DB_CONNECTION defaults to sqlite in .env.example.
  • webpatser/fledge-fiber and webpatser/fledge-framework in require.

Redis client

The fledge client is the non-blocking client from fledge-fiber. Cache, session, queue and lock traffic suspends the current Fiber instead of blocking the process. To use the phpredis extension instead, install it and set:

REDIS_CLIENT=phpredis

Non-blocking database connections

Set DB_CONNECTION=fledge-mysql in .env to use the non-blocking MySQL driver. The available connections are fledge-mysql, fledge-mariadb and fledge-pgsql. They read the same DB_* variables as the stock connections, except DB_URL: the fiber connections have no url key, because Laravel's URL parser replaces the connection's driver with the URL scheme and a mysql:// URL would turn them into blocking PDO connections. Set DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD instead.

Upgrading an app created from an older skeleton

Earlier skeleton versions shipped config that no Fledge package registers. If your app was created from one of them:

  • Rename the amphp-mysql, amphp-mariadb and amphp-pgsql connections in config/database.php, and their driver values, to fledge-mysql, fledge-mariadb and fledge-pgsql. Update DB_CONNECTION and any DB::connection('amphp-...') calls to match.
  • REDIS_CLIENT=amphp has no connector. Change it to fledge, or to phpredis if you want the extension.
  • Remove the url key from the fiber connections and set DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD instead.