Download the PHP package cachewerk/bref-laravel-bridge without Composer

On this page you can find all versions of the php package cachewerk/bref-laravel-bridge. 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 bref-laravel-bridge

Bref Laravel Bridge

An advanced Laravel integration for Bref, including Octane support.

This project is largely based on code from PHP Runtimes, Laravel Vapor and Bref's Laravel Bridge.

Background

Why does this exist and why not just use Laravel Vapor? Vapor is fantastic, easy to use and the better choice for situations, its $399/year pay for itself not having to maintain your own infrastructure.

For Relay's API however we needed something that 1) is open source (Vapor's API is a black box), 2) is secure (Vapor has admin access to databases and environment variables) and 3) doesn't leave us at the mercy of a support team (Vapor has no enterprise support). We also didn't want to be forced to use CloudFront on top of Cloudflare, but that's just nerdy preference.

We needed an open source solution that gives us more fine-grained control and is secure.

Bref + Serverless Framework is exactly that, however Bref's Laravel integration is rather basic, it easily exposes SSM secrets and it doesn't support Laravel Octane.

So we built this.

Installation

First, be sure to familiarize yourself with Bref and its guide to Serverless Laravel applications.

Next, install the package and publish the custom Bref runtime:

By default the runtime is published to php/ where Bref's PHP configuration resides, but it can be move anywhere.

Next, we need to set up in the AWS_ACCOUNT_ID environment variable in your serverless.yml:

Then set up your functions:

If you don't want to use Octane, simply remove APP_RUNTIME and BREF_LOOP_MAX from the web function.

To avoid setting secrets as environment variables on your Lambda functions, you can inject them directly into the Lambda runtime:

This will inject APP_KEY and DATABASE_URL using your service name and stage, for example from /myapp-staging/APP_KEY.

Finally, deploy your app:

Check out some more comprehensive examples.

Configuration

Serving static assets

If you want to serve some static assets from your app's public directory, you can use the ServeStaticAssets middleware.

First, publish the configuration:

Then define the files you want to serve in bref.assets.

Lastly tell Bref to support binary responses on your web function:

Persistent database sessions

If you're using PostgreSQL 9.6 or newer, you can take advantage of persistent database sessions.

First set idle_in_transaction_session_timeout either in your RDS database's parameter group, or on a specific database itself.

Lastly, set the OCTANE_PERSIST_DATABASE_SESSIONS environment variable.

Usage

Artisan Console

Just like with Bref, you may execute console commands.

Maintenance mode

Similar to the php artisan down command, you may put your app into maintenance mode. All that's required is setting the MAINTENANCE_MODE environment variable:

You can then quickly put all functions into maintenance without running a full build and CloudFormation deploy:

To take your app out of maintenance mode, simply omit the parameter:

One caveat with the --update-config flag is that it doesn't do objects in environment variables in the serverless.yml:


All versions of bref-laravel-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
aws/aws-sdk-php Version ^3.222
bref/bref Version ^1.5
illuminate/container Version ^8.0|^9.0
illuminate/contracts Version ^8.0|^9.0
illuminate/http Version ^8.0|^9.0
illuminate/queue Version ^8.0|^9.0
illuminate/support Version ^8.0|^9.0
laravel/octane Version ^1.2
monolog/monolog Version ^2.0
riverline/multipart-parser Version ^2.0
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 cachewerk/bref-laravel-bridge contains the following files

Loading the files please wait ....