PHPackages                             marchie/lad-utils - 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. [CLI &amp; Console](/categories/cli)
4. /
5. marchie/lad-utils

ActiveLibrary[CLI &amp; Console](/categories/cli)

marchie/lad-utils
=================

Command line utilities for executing Composer post install commands when deploying Laravel applications in Azure

1105PHP

Since Mar 1Pushed 10y agoCompare

[ Source](https://github.com/Marchie/lad-utils)[ Packagist](https://packagist.org/packages/marchie/lad-utils)[ RSS](/packages/marchie-lad-utils/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Azure Deployment Utilities (marchie/lad-utils)
======================================================

[](#laravel-azure-deployment-utilities-marchielad-utils)

TL; DR
------

[](#tl-dr)

Artisan commands to aid deployment of Laravel applications in Microsoft Azure.

Backstory
---------

[](#backstory)

Deploying Laravel applications into Azure is a little bit of a dark art.

There are [guides](http://blog.bobbyallen.me/2015/06/26/configuring-and-hosting-laravel-5-x-applications-on-windows-azure/) [out there](http://stackoverflow.com/questions/32109245/deploy-laravel-to-azure) on how to do it, but for me, the end result wasn't quite what I'd hoped for.

What do I mean by that? Well, I'm deploying my applications using [SyntaxC4's Composer Extension](https://github.com/SyntaxC4-MSFT/ComposerExtension/), which is great. However, the standard Laravel optimization command is problematic:-

`php artisan optimize` *runs like a dog*. I'm talking about half an hour to complete on a dual-core Azure instance, or *never* (read: over 24 hours before I killed it) finishing on a single-core instance, compared with a couple of seconds on my modest development box. Worse still, the major time-consuming thing that the `php artisan optimize` command does is to run `composer dump-autoload -o`, which has *already been done* by the Composer Extension on Azure.

(NB: The reason seems to be something to do with the number of processes that end up running through the post install command. Composer is a PHP application, which calls the post install commands on the command line. The `php artisan optimize` post install command kicks off another PHP process, which then calls `composer dump-autoload -o` on the command line. This starts up yet another PHP process and everything just seems to grind to a halt.)

What this package does
----------------------

[](#what-this-package-does)

This package gives you an additional Artisan command, which you can call as post install commands in your `composer.json`:-

`azure:optimize-classes` extends the standard Artisan `optimize` command, except it *doesn't* call `composer dump-autoload -o`. Note that if you have your application in debug mode, the classes will **not** be compiled.

(NB: The `composer dump-autoload -o` command is already called by the Azure Composer Extension)

(Credit to [@22media on Laracasts](https://laracasts.com/discuss/channels/servers/deploying-as-an-azure-web-app) for the legwork on this)

Usage
-----

[](#usage)

You need to add the package to your `composer.json` file:

```
{
    ...
    "require": {
        ...
        "marchie/lad-utils": "dev-master",
        ...
    },
    ...
}
```

Then, run `composer update` to pull in the package.

After the package has been pulled in, add the package's service provider into your Laravel application's `config/app.php` file:

```
return [
    ...
    'providers' => [
        ...
        Marchie\LaravelAzureDeploymentUtilities\ServiceProvider::class,
        ...
    ]
    ...
]
```

With that done, you can use the commands in your `composer.json` `post-install-cmd`:

```
{
    ...
    "scripts": {
        ...
        "post-install-cmd": [
            "php -r \"copy('%HOME\\site\\.env', '.env');\"",
            ...
            "php artisan azure:optimize-classes",
            ...
            "php -r \"unlink('.env');\""
        ],
        ...
    },
    ...
}
```

Note that we are copying the `.env` file into the repository first (Laravel needs this file). Then, we run the other post-install commands. Finally, we delete the copied `.env` file from the repository.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/marchie-lad-utils/health.svg)

```
[![Health](https://phpackages.com/badges/marchie-lad-utils/health.svg)](https://phpackages.com/packages/marchie-lad-utils)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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