PHPackages                             sammyjo20/lasso - 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. sammyjo20/lasso

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

sammyjo20/lasso
===============

Lasso - Asset wrangling for Laravel made simple.

v3.5.0(1mo ago)355347.9k↑26.5%19MITPHPPHP ^8.2CI passing

Since Aug 27Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/Sammyjo20/Lasso)[ Packagist](https://packagist.org/packages/sammyjo20/lasso)[ GitHub Sponsors](https://github.com/sammyjo20)[ RSS](/packages/sammyjo20-lasso/feed)WikiDiscussions v3.0 Synced 1mo ago

READMEChangelog (10)Dependencies (22)Versions (55)Used By (0)

 [![Lasso](https://private-user-images.githubusercontent.com/29132017/346272360-7033cce2-ef5a-46b0-a01b-69e6f9f2e4c4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyODY1MzEsIm5iZiI6MTc3NTI4NjIzMSwicGF0aCI6Ii8yOTEzMjAxNy8zNDYyNzIzNjAtNzAzM2NjZTItZWY1YS00NmIwLWEwMWItNjllNmY5ZjJlNGM0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA0VDA3MDM1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxM2M2MzY2NGIwMDE4MjAyMDc2MmNiNzQ2YTY5NGI3YjNjZDQ0NjczMGY1ZTJhZjk0MjJhMzY2OWIyODcyNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.l3BpSHpF4s8NDYihc8x0pEHk3c1H4lrMONGdFFg_OAs)](https://private-user-images.githubusercontent.com/29132017/346272360-7033cce2-ef5a-46b0-a01b-69e6f9f2e4c4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyODY1MzEsIm5iZiI6MTc3NTI4NjIzMSwicGF0aCI6Ii8yOTEzMjAxNy8zNDYyNzIzNjAtNzAzM2NjZTItZWY1YS00NmIwLWEwMWItNjllNmY5ZjJlNGM0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA0VDA3MDM1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQxM2M2MzY2NGIwMDE4MjAyMDc2MmNiNzQ2YTY5NGI3YjNjZDQ0NjczMGY1ZTJhZjk0MjJhMzY2OWIyODcyNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.l3BpSHpF4s8NDYihc8x0pEHk3c1H4lrMONGdFFg_OAs)

Lasso
=====

[](#lasso)

### Asset wrangling for Laravel made simple.

[](#asset-wrangling-for-laravel-made-simple)

[![Latest Stable Version](https://camo.githubusercontent.com/20a4bbcf3ae900c84c6e2d9b16de36c27b0e704d0da01b2e58b0b680fc8fe6d7/68747470733a2f2f706f7365722e707567782e6f72672f73616d6d796a6f32302f6c6173736f2f76)](//packagist.org/packages/sammyjo20/lasso) [![Total Downloads](https://camo.githubusercontent.com/717a43e7d39072e65cbf9e3b38a28ed5aa59ac742a8c25b5805da03fe9265dd6/68747470733a2f2f706f7365722e707567782e6f72672f73616d6d796a6f32302f6c6173736f2f646f776e6c6f616473)](//packagist.org/packages/sammyjo20/lasso) [![License](https://camo.githubusercontent.com/b8254d8ce4e2bdd0c8e27466abf87628af85c54037639b57486f8729444b7984/68747470733a2f2f706f7365722e707567782e6f72672f73616d6d796a6f32302f6c6173736f2f6c6963656e7365)](//packagist.org/packages/sammyjo20/lasso)[![Build Status](https://github.com/sammyjo20/lasso/actions/workflows/tests.yml/badge.svg)](https://img.shields.io/github/actions/workflow/status/sammyjo20/lasso/tests.yml?label=tests)

### Introduction

[](#introduction)

Deploying assets in Laravel can be a nightmare. One problem developers have is dealing with their built assets (created by Webpack/Laravel Mix or Vite). Do you store them in version control? Do you deploy them on the server? What if I'm working with a team? Each of these solutions for assets can cause headaches for the developer, including merge conflicts and slowing down servers.

Lasso is a Laravel package designed to take the headaches out of deploying assets to your servers. It works great on load balanced environments too.

### What does Lasso do?

[](#what-does-lasso-do)

Lasso compiles your assets on your local machine or within Continuous Integration (e.g GitHub Actions) and then uploads the assets to one of your Laravel Filesystems. This harnesses the power of your local machine which is likely much more powerful than the server.

During deployment, Lasso will then download your assets from the filesystem. It uses Git to keep track of the last asset bundle created, as well as automatically cleans old bundles.

Installation
------------

[](#installation)

Lasso supports Laravel 9+ and PHP 8.1 or higher. To install Lasso, simply run the composer require command below:

```
composer require sammyjo20/lasso "^3.0"
```

After that, run the command below to create the lasso.php config file:

```
php artisan vendor:publish --tag=lasso-config
```

Configuration
-------------

[](#configuration)

Now make sure to configure the lasso.php config file in your app/config directory. Make sure to specify a Filesystem Disk you would like Lasso to use.

**If you have multiple projects, make sure to change the "upload\_to" path, otherwise you may have asset conflicts in your applications.**

Getting Setup
-------------

[](#getting-setup)

Make sure to add all of your public assets that are created by Webpack/Laravel Mix to your .gitignore file. Make sure to also add the ".lasso" directory to your .gitignore file.

Example:

```
mix-manifest.json
public/css/*
public/js/*
public/build/**/*
public/
.lasso

```

> The .lasso folder is a temporary directory created by Lasso to keep assets while they're being zipped up. This folder is automatically created and deleted, but it's good to ignore this directory anyway, just in case Lasso falls over before it reaches the cleanup phase.

Vite Support
------------

[](#vite-support)

Lasso supports Vite with a few config changes. In `config/lasso.php`, change `compiler.script` to `yarn run build`, `compiler.excluded_files` to `['hot']` to exclude Vite's "hot" file and `compiler.output` to `disable` (progress bar output is not yet supported for Vite).

```
  'script' => 'yarn run build',
  'output' => 'disable',
  'excluded_files' => ['hot'],
```

Recommended Usage
-----------------

[](#recommended-usage)

Lasso comes with two commands that should be used by your project/deployment process. The recommended usage is to run the "publish" command on your local machine, which is likely much more powerful than Continuous Integration or compiling on the server.

### Publish

[](#publish)

The publish command should be executed when you would like to upload/publish new assets to your application. Lasso will run the provided script (e.g npm run production) and then zip up the files created by the compiler (e.g Webpack).

```
php artisan lasso:publish
```

After running this command, Lasso will create a "lasso-bundle.json" file in your application's root directory. This is the recommended approach as when you commit the file, Lasso will use this to download the latest bundle relating to your commit. If you don't use Git, for example if you are compiling assets within Continuous Integration, you can add the `--no-git` flag to the command.

**Warning: When using the `--no-git` flag, versioning will be limited as the lasso-bundle.json is stored in your Filesystem, rather than your repository. Using Git is the recommended approach.**

If you use git, and want to easily keep track of which bundle file is for what commit, use the `--use-commit` flag. It will ensure the bundle zip file name is the first 12 characters of the commit hash. This also adds the advantage of publishing the bundles during your CI pipeline, without having to make a new commit, whilst giving the versioning benefits of using git.

### Pull

[](#pull)

The pull command should then be executed on your deployment script, or on the servers which will require the assets to be on. Simply run the command below. If you are using *Laravel Forge*, add this command to your deployment script. If you are using *Laravel Envoyer*, add this to the list of hooks during your deployment. It should be run on **every server**.

Use the `--use-commit` flag when pulling, if you are publishing the bundles with the `--use-commit` flag.

```
php artisan lasso:pull
```

Usage within Continuous Integration (CI) e.g Github Actions
-----------------------------------------------------------

[](#usage-within-continuous-integration-ci-eg-github-actions)

To use Lasso during continuous integration, it's recommended to run the `php artisan lasso:publish` command, and then commit the "lasso-bundle.json" file which is created. If you aren't able to commit files during your CI process, use the `--no-git` flag on the command, e.g: `php artisan lasso:publish --no-git`

Read this excellent blog post by Alex Justesen on how to integrate Lasso with your CI/CD pipeline:

Multiple Environments
---------------------

[](#multiple-environments)

Out of the box, Lasso supports multi-environment applications. If your application has a staging environment, for example - you can use the `LASSO_ENV` environment variable to set the current environment. On your web servers:

```
LASSO_ENV=staging
```

Webhooks
--------

[](#webhooks)

Lasso can also trigger webhooks when a command has been executed successfully. Simply list the URLs in the "webhooks" array in the lasso.php config file.

```
/*
* Lasso will can also trigger Webhooks after its commands have been
* successfully executed. You may specify URLs that Lasso will POST
* to, for each of the commands.
*/
'webhooks' => [

  /*
  * Specify which webhooks should be triggered after a successful
  * "php artisan lasso:publish" command execution.
  */
  'publish' => [
    //
   ],

  /*
   * Specify which webhooks should be triggered after a successful
   * "php artisan lasso:pull" command execution.
   */
  'pull' => [
    //
  ]

],
```

Cleanup
-------

[](#cleanup)

Lasso will automatically try to keep your Filesystem clean, and will automatically delete old bundles. You can increase/decrease the amount of Bundles Lasso will keep per enviroment by setting the `max_bundles` configuratiion variable in the config/lasso.php file.

```
/*
 * Lasso will automatically version the assets. This is useful if you
 * suddenly need to roll-back a deployment and use an older version
 * of built files. You can set the maximum amount of files stored here.
 */
'max_bundles' => 5,
```

Excluded files/directories
--------------------------

[](#excluded-filesdirectories)

Lasso will copy the public directory during it's publish process. If you have any files or directories that you would like Lasso to ignore during this process, specify them in the `excluded_files` and `excluded_directories` configuation variables in the config/lasso.php file.

```
/*
 * If there any directories/files you would like to Lasso to
 * exclude when uploading to the Filesystem, specify them below.
 */
'excluded_files' => [],

'excluded_directories' => [],
```

Thanks
------

[](#thanks)

Special thanks to @codepotato for the logo! ❤️

---

Security
--------

[](#security)

If you find any security related issues, please send an email to

And that's it! ✨
----------------

[](#and-thats-it-)

This is my first Laravel package, I really hope it's been useful to you, if you like my work and want to show some love, consider buying me some coding fuel (Coffee) ❤

[Donate Java (the drink not the language)](https://ko-fi.com/sammyjo20)

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity55

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 79.4% 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 ~39 days

Recently: every ~185 days

Total

53

Last Release

54d ago

Major Versions

v0.1.99 → v1.02020-08-31

1.2.8 → v2.0.12022-01-23

v2.0.2 → v3.0.02022-04-07

v2.0.x-dev → v3.0.12022-06-10

PHP version history (6 changes)v0.1.0PHP &gt;7.3

v0.1.96PHP ^7.3

1.2.7PHP ^7.3 || ~8.0

v2.0.1PHP ^8.0

v3.1.0PHP ^8.1

v3.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/de41c8bfde9d0edb25da9fdc159283fe9442e3dc9b651ee9aa7ded8384e5629d?d=identicon)[SamCarre](/maintainers/SamCarre)

---

Top Contributors

[![Sammyjo20](https://avatars.githubusercontent.com/u/29132017?v=4)](https://github.com/Sammyjo20 "Sammyjo20 (204 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (26 commits)")[![Jhnbrn90](https://avatars.githubusercontent.com/u/24190396?v=4)](https://github.com/Jhnbrn90 "Jhnbrn90 (8 commits)")[![cwilsn](https://avatars.githubusercontent.com/u/382106?v=4)](https://github.com/cwilsn "cwilsn (5 commits)")[![codepotato](https://avatars.githubusercontent.com/u/417524?v=4)](https://github.com/codepotato "codepotato (3 commits)")[![husonghua](https://avatars.githubusercontent.com/u/844636?v=4)](https://github.com/husonghua "husonghua (2 commits)")[![BinaryKitten](https://avatars.githubusercontent.com/u/67553?v=4)](https://github.com/BinaryKitten "BinaryKitten (2 commits)")[![go0sedev](https://avatars.githubusercontent.com/u/7044766?v=4)](https://github.com/go0sedev "go0sedev (2 commits)")[![jannejava](https://avatars.githubusercontent.com/u/543616?v=4)](https://github.com/jannejava "jannejava (1 commits)")[![io238](https://avatars.githubusercontent.com/u/26689138?v=4)](https://github.com/io238 "io238 (1 commits)")[![joeycoonce](https://avatars.githubusercontent.com/u/1059971?v=4)](https://github.com/joeycoonce "joeycoonce (1 commits)")[![alexjustesen](https://avatars.githubusercontent.com/u/1144087?v=4)](https://github.com/alexjustesen "alexjustesen (1 commits)")[![cbl](https://avatars.githubusercontent.com/u/29352871?v=4)](https://github.com/cbl "cbl (1 commits)")

---

Tags

ci-cddeploymentshacktoberfestlaravellaravel-mixphpwebpack

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sammyjo20-lasso/health.svg)

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

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[laravel-zero/framework

The Laravel Zero Framework.

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

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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