PHPackages                             vanilla/laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vanilla/laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vanilla/laravel
===============

Utilities and Commands for working with Laravel.

v1.1(2y ago)0167.8k—4.6%MITPHPPHP &gt;=8.0

Since Jul 27Pushed 2y ago2 watchersCompare

[ Source](https://github.com/vanilla/vanilla-laravel)[ Packagist](https://packagist.org/packages/vanilla/laravel)[ RSS](/packages/vanilla-laravel/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

vanilla/laravel
===============

[](#vanillalaravel)

A set of common laravel utilities and configurations used in Vanilla laravel services.

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

[](#installation)

Require this package with composer using the following command:

```
composer require vanilla/laravel
```

This package makes use of Laravels package auto-discovery mechanism so it should automatically be applied.

Additional Logging Context
--------------------------

[](#additional-logging-context)

This is automatically configured if the package is installed through composer.

Every made during a web request will have the following additional data applied.

```
{
    // ... Basic log data here.
    "tags": ["webRequest"],
    "request": {
        "hostname": "www.your-service.com",
        "method": "GET",
        "path": "/some/path/here?queryParams",
        "protocol": "https",
        "url": "https://www.your-service.com/some/path/here?queryParams",
        "clientIP": "0.0.0.0"
    }
}
```

Improved JSON Log Formatter
---------------------------

[](#improved-json-log-formatter)

To apply this, update your desired log channel in `config/logging.php` file to use the new log formatter.

**`config/logging.php`**

```
return [
    // ...Other configs here
    "channels" => [
        // ...Other configs here
        "single" => [
            "driver" => "single",
            "formatter" => VanillaLogFormatter::class,
            "path" => storage_path("logs/laravel.log"),
            "level" => env("LOG_LEVEL", "debug"),
        ],
        "syslog" => [
            "driver" => "syslog",
            "formatter" => VanillaLogFormatter::class,
            "level" => env("LOG_LEVEL", "debug"),
        ],
        // ...Other configs here
    ],
    // ...Other configs here
];
```

The improved log formatter provides the following behaviours:

- Outputs logs as serialized JSON prepended with `$json:` in the standard vanilla `v2` logging schema.
- `Vanilla\Laravel\Exception\ContextException` instances will now have their context serialized.
- Exception stack traces have improved serialization.
    - Frames do not include the base path of the repo.
    - Certain common frames are always excludes (like ones in the log formatter and exception handler).
    - Vendor stack frames are collapsed.
    - Only files and line numbers are included.
- All logs get a minimal stacktrace.

Improved Exception Handling
---------------------------

[](#improved-exception-handling)

To apply this have your exception handler in `Exceptions\Handler.php` extend from `Vanilla\Laravel\Exceptions\ExceptionHandler` instead of `Illuminate\Foundation\Exceptions\Handler`.

It has the following improved behaviours

- API responses will always be serialized as JSON.
- Thrown `ContextExceptions` will serialize their context.
- If the `app.debug` config is enabled then stack traces will be returned in the JSON output.

Context Exceptions
------------------

[](#context-exceptions)

Oftentimes when you throw an exception you might have some useful structured data that you want captured for logging or an HTTP response.

For these case throw or extend `Vanilla\Laravel\Exceptions\ContextException`. It adds an optional array of `context`.

Want to add additional context to a caught `ContextException`? Use `ContextException::withContext($newContext)`.

Configuration Validation
------------------------

[](#configuration-validation)

This package registers a new command `artisan config:validate` that will automatically run before `config:cache`. It will look through your configuration files for validation specification under a `ValidateConfigCommand::KEY` key and validate the rest of that configuration file according to those rules.

### Example

[](#example)

**orch.php**

```
return [
    ///
    /// Config validate here!!!
    ///
    ValidateConfigCommand::KEY => [
        "type" => ["in:orchestration,local"],
        "base_url" => ["required", "url"],
        "search_service_base_url" => ["required", "url"],
        "hostname" => ["string"],
        "token" => ["string", "required"],
        "network" => ["string", "required"],
        "zone" => ["string", "required"],
    ],

    /*
    |--------------------------------------------------------------------------
    | Orchestration
    |--------------------------------------------------------------------------
    |
    | These fields are used for accessing orchestration and fetching site info.
    */
    "type" => env("ORCH_TYPE", $isOrchestration ? "orchestration" : "local"),

    // Base URL for orchestration.
    "base_url" => env("ORCH_BASE_URL"),

    // Optional. Primarily used in localhost to force `Host` header with a base_url of an internalIP for the VPN.
    "hostname" => env("ORCH_HOSTNAME"),

    // Access token used to call orchestration.
    "token" => env("ORCH_TOKEN"),

    // Which orchestration network to use.
    "network" => env("ORCH_NETWORK"),

    // Which orchestration zone to use.
    "zone" => env("ORCH_ZONE"),

    // Base url to use when calling elasticsearch.
    "search_service_base_url" => env("ORCH_SEARCH_SERVICE_BASE_URL"),
];
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~8 days

Total

6

Last Release

1031d ago

### Community

Maintainers

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

---

Top Contributors

[![charrondev](https://avatars.githubusercontent.com/u/1770056?v=4)](https://github.com/charrondev "charrondev (13 commits)")

---

Tags

production

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vanilla-laravel/health.svg)

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

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.7k1](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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