PHPackages                             hammerstone/sidecar - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. hammerstone/sidecar

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

hammerstone/sidecar
===================

A Laravel package to deploy Lambda functions alongside your main application.

v0.7.1(8mo ago)8832.7M—6%83[26 issues](https://github.com/aarondfrancis/sidecar/issues)[5 PRs](https://github.com/aarondfrancis/sidecar/pulls)10MITPHPPHP ^8.1CI passing

Since May 16Pushed 5mo ago13 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (32)Used By (10)

Sidecar for Laravel
===================

[](#sidecar-for-laravel)

[![Tests](https://github.com/hammerstonedev/sidecar/actions/workflows/tests.yml/badge.svg)](https://github.com/hammerstonedev/sidecar/actions/workflows/tests.yml) [![Latest Stable Version](https://camo.githubusercontent.com/b409e12853fcd2f1e251dd3d4dbde6d479cd0277980cef906b6cbf339c3bf2ac/68747470733a2f2f706f7365722e707567782e6f72672f68616d6d657273746f6e652f736964656361722f76)](//packagist.org/packages/hammerstone/sidecar) [![Total Downloads](https://camo.githubusercontent.com/b9ca89d9697a7193d0a393d29b14627d39063d0b09a98dd32db0cddc739c05b2/68747470733a2f2f706f7365722e707567782e6f72672f68616d6d657273746f6e652f736964656361722f646f776e6c6f616473)](//packagist.org/packages/hammerstone/sidecar) [![License](https://camo.githubusercontent.com/b4275cbc66b15a3b0bf4827a5b790ee7315b08b6febd7497611cef3708e18829/68747470733a2f2f706f7365722e707567782e6f72672f68616d6d657273746f6e652f736964656361722f6c6963656e7365)](//packagist.org/packages/hammerstone/sidecar)

### Deploy and execute AWS Lambda functions from your Laravel application.

[](#deploy-and-execute-aws-lambda-functions-from-your-laravel-application)

> Read the full docs at [hammerstone.dev/sidecar/docs](https://hammerstone.dev/sidecar/docs/main/overview).

Follow me on Twitter for more updates: [twitter.com/aarondfrancis](https://twitter.com/aarondfrancis).

If you're a visual learner, watch the [Laracasts series](https://laracasts.com/series/developing-serverless-functions-in-laravel).

To install, simply require the package from composer: `composer require hammerstone/sidecar`

This package is still under development, please open issues for anything you run into.

What Sidecar Does
-----------------

[](#what-sidecar-does)

Sidecar packages, creates, deploys, and executes Lambda functions from your Laravel application.

You can write functions in any of the following runtimes and execute them straight from PHP:

- Node.js 20
- Node.js 18
- Python 3.12
- Python 3.11
- Python 3.10
- Python 3.9
- Java 21
- Java 17
- Java 11
- Java 8
- .NET 8
- .NET 6
- Ruby 3.3
- Ruby 3.2
- OS-only runtime (Amazon Linux 2023)
- OS-only runtime (Amazon Linux 2)

Any runtime that [Lambda supports](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html), you can use!

Sidecar is maintained by [Aaron Francis](https://twitter.com/aarondfrancis), go follow me on Twitter!

### What It Looks Like

[](#what-it-looks-like)

Every Sidecar Function requires two things:

- A PHP Class
- Files that you want deployed to Lambda

For example, if we were wanting to use Node on Lambda to generate an og:image for all of our blog posts, we would first set up a simple class in PHP called `OgImage`.

`App\Sidecar\OgImage.php`

```
namespace App\Sidecar;

use Hammerstone\Sidecar\LambdaFunction;

class OgImage extends LambdaFunction
{
    public function handler()
    {
        // Define your handler function.
        return 'lambda/image.handler';
    }

    public function package()
    {
        // All files and folders needed for the function.
        return [
            'lambda',
        ];
    }
}
```

That's it! There are a lot more options, but that's all that is required.

The second thing you'd need is your function's "handler", in this case a javascript file.

Here's a simple JS file that could serve as our handler:

`resources/lambda/image.js`

```
const {createCanvas} = require('canvas')

exports.handler = async function (event) {
    const canvas = createCanvas(1200, 630)
    const context = canvas.getContext('2d')

    context.font = 'bold 70pt Helvetica'
    context.textAlign = 'center'
    context.fillStyle = '#3574d4'

    // Read the text out of the event passed in from PHP.
    context.fillText(event.text, 600, 170);

    // Return an image.
    return canvas.toDataURL('image/jpeg');
}
```

With those files created, you can deploy this function to Lambda:

```
php artisan sidecar:deploy --activate

```

And then execute it straight from your Laravel app!

`web.php`

```
Route::get('/ogimage', function () {
    return OgImage::execute([
        'text' => 'PHP to JS and Back Again!'
    ]);
});
```

Sidecar passes the payload from `execute` over to your Javascript function. Your Javascript function generates an image and sends it back to PHP.

Sidecar reduces the complexity of deploying small bits of code to Lambda.

### Why Sidecar Exists

[](#why-sidecar-exists)

[AWS Lambda](https://aws.amazon.com/lambda/) is a powerful service that allows you to run code without provisioning or thinking about servers.

[Laravel Vapor](https://vapor.laravel.com/) brought that power to Laravel. Using Vapor, you can run your plain ol' Laravel apps on a serverless platform and get incredible speed, security, and reliability.

Using Lambda through Vapor is a wonderful developer experience, but there are times when building your applications that you need to run just *one or two* Node functions for some reason. Common use cases could be taking screenshots with headless Chrome, generating images, or doing server-side rendering of your Javascript frontend.

Or maybe you want to run a Python script without configuring a server? Or a single Ruby script. Or even Java!

When running on a serverless platform, it's not quite as easy as installing Node and running your functions. You don't have access to the server! So you end up deploying a single Vercel or Netlify function and calling it over HTTP or just forgetting the thing altogether.

Sidecar brings the ease of Vapor to those non-PHP functions.

What Sidecar Doesn't Do
-----------------------

[](#what-sidecar-doesnt-do)

Sidecar does *not* handle any API Gateway, Databases, Caches, etc. The *only* thing Sidecar concerns itself with is packaging, creating, deploying, and executing Lambda functions.

Sidecar does not provide a way to execute a function via HTTP. You must execute it from your Laravel app through the provided methods.

If you need those other services, you are encouraged to use the instances that Vapor has set up for you, or set them up yourself.

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance65

Regular maintenance activity

Popularity66

Solid adoption and visibility

Community39

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 62.5% 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.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~130 days

Total

27

Last Release

268d ago

PHP version history (4 changes)v0.1.0PHP ^7.2|^8.0

v0.4.0PHP ^7.3|^8.0

v0.4.1PHP ^7.4|^8.0

v0.6.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/033238953a59b9223a1bde703b5e4254e63c7412195da1cb9de5af44bf53fc0a?d=identicon)[aarondfrancis](/maintainers/aarondfrancis)

---

Top Contributors

[![aarondfrancis](https://avatars.githubusercontent.com/u/881931?v=4)](https://github.com/aarondfrancis "aarondfrancis (200 commits)")[![wilsenhc](https://avatars.githubusercontent.com/u/13445515?v=4)](https://github.com/wilsenhc "wilsenhc (34 commits)")[![drjdr](https://avatars.githubusercontent.com/u/55947988?v=4)](https://github.com/drjdr "drjdr (15 commits)")[![inxilpro](https://avatars.githubusercontent.com/u/21592?v=4)](https://github.com/inxilpro "inxilpro (10 commits)")[![stefanzweifel](https://avatars.githubusercontent.com/u/1080923?v=4)](https://github.com/stefanzweifel "stefanzweifel (8 commits)")[![bookwyrm](https://avatars.githubusercontent.com/u/4792?v=4)](https://github.com/bookwyrm "bookwyrm (6 commits)")[![maurocasas](https://avatars.githubusercontent.com/u/2125644?v=4)](https://github.com/maurocasas "maurocasas (5 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (5 commits)")[![nexxai](https://avatars.githubusercontent.com/u/4316564?v=4)](https://github.com/nexxai "nexxai (4 commits)")[![jryd](https://avatars.githubusercontent.com/u/13251203?v=4)](https://github.com/jryd "jryd (4 commits)")[![clarkeash](https://avatars.githubusercontent.com/u/1612186?v=4)](https://github.com/clarkeash "clarkeash (3 commits)")[![bakerkretzmar](https://avatars.githubusercontent.com/u/18192441?v=4)](https://github.com/bakerkretzmar "bakerkretzmar (3 commits)")[![Akecel](https://avatars.githubusercontent.com/u/32711265?v=4)](https://github.com/Akecel "Akecel (2 commits)")[![benbjurstrom](https://avatars.githubusercontent.com/u/12499093?v=4)](https://github.com/benbjurstrom "benbjurstrom (2 commits)")[![joedixon](https://avatars.githubusercontent.com/u/3438564?v=4)](https://github.com/joedixon "joedixon (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![w00key](https://avatars.githubusercontent.com/u/280858?v=4)](https://github.com/w00key "w00key (2 commits)")[![livingos](https://avatars.githubusercontent.com/u/3140786?v=4)](https://github.com/livingos "livingos (1 commits)")[![lukeraymonddowning](https://avatars.githubusercontent.com/u/12202279?v=4)](https://github.com/lukeraymonddowning "lukeraymonddowning (1 commits)")[![Froelund](https://avatars.githubusercontent.com/u/2089088?v=4)](https://github.com/Froelund "Froelund (1 commits)")

---

Tags

aws-lambdalambdalaravelserverlesssidecar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hammerstone-sidecar/health.svg)

```
[![Health](https://phpackages.com/badges/hammerstone-sidecar/health.svg)](https://phpackages.com/packages/hammerstone-sidecar)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[sammyjo20/lasso

Lasso - Asset wrangling for Laravel made simple.

355347.9k](/packages/sammyjo20-lasso)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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