PHPackages                             entrie-cloud/laravel-cockpit - 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. entrie-cloud/laravel-cockpit

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

entrie-cloud/laravel-cockpit
============================

Integrates Cockpit CMS with Laravel with caching.

v0.1.4(11mo ago)122MITPHPPHP ^8.1

Since Dec 5Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/entrie-cloud/laravel-cockpit)[ Packagist](https://packagist.org/packages/entrie-cloud/laravel-cockpit)[ Docs](https://github.com/entrie-cloud/laravel-cockpit)[ GitHub Sponsors](https://github.com/BorisKM)[ RSS](/packages/entrie-cloud-laravel-cockpit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (9)Used By (0)

Laravel Cockpit Integration Package
===================================

[](#laravel-cockpit-integration-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7028068292bdb19c049de618b06703dcea30e32fe4cfe3f77f5760e68211c70f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e747269652d636c6f75642f6c61726176656c2d636f636b7069742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/entrie-cloud/laravel-cockpit)[![Total Downloads](https://camo.githubusercontent.com/c8f851b0b46e687c7767cde476c5750d2af5994cc43839c9843ae47939527dd4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e747269652d636c6f75642f6c61726176656c2d636f636b7069742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/entrie-cloud/laravel-cockpit)

A Laravel package designed to seamlessly integrate with [Cockpit](https://getcockpit.com/), providing tools to interact with its API, manage connections, and improve performance with advanced caching mechanisms.

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

[](#installation)

You can install the package via composer:

```
composer require entrie-cloud/laravel-cockpit
```

Env variables to work out of the box:

```
COCKPIT_API_URL=
COCKPIT_API_KEY=
COCKPIT_STORAGE_URL=
```

You can publish the config file with:

```
php artisan vendor:publish --tag="cockpit-config"
```

This is the contents of the published config file:

```
return [

    // The default connection name to use for Cockpit API calls.
    'default' => env('COCKPIT_CONNECTION', 'main'),

    // The URL path prefix to trigger cache clearing for Cockpit cache.
    'cache_clear_path' => env('COCKPIT_CACHE_CLEAR_PATH', '/cockpit-cache-clear'),

    // The query parameter name used to bypass caching when accessing Cockpit API routes.
    'cache_ignore_query' => env('COCKPIT_CACHE_IGNORE_QUERY', 'cockpit-cache-ignore'),

    // List of available connections to Cockpit instances.
    'connections' => [

        // The main connection configuration for interacting with Cockpit.
        'main' => [
            // The base URL of the Cockpit API.
            'api_url' => env('COCKPIT_API_URL'),

            // The API key for authenticating requests to the Cockpit API.
            'api_key' => env('COCKPIT_API_KEY'),

            // The URL to access Cockpit's storage, such as uploads or assets.
            'storage_url' => env('COCKPIT_STORAGE_URL'),

            // Lifetime of the cache in seconds. If set to `true`, caching is enabled indefinitely.
            'cache_lifetime' => env('COCKPIT_CACHE_LIFETIME', true),

            // Secret key for ignoring cache when querying Cockpit via `cache_ignore_query`.
            'cache_ignore_secret' => env('COCKPIT_CACHE_IGNORE_SECRET'),

            // Secret key for clearing Cockpit cache via `cache_clear_path`.
            'cache_clear_secret' => env('COCKPIT_CACHE_CLEAR_SECRET'),
        ],

    ],

];
```

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

```
// Also have alias `LaravelCockpit`
use EntrieCloud\LaravelCockpit\Facades\LaravelCockpit;

// GET request
$data = LaravelCockpit::get('/path/to/resource');
$data = LaravelCockpit::get('/path/to/resource', ['sort' => ['order' => -1]]);

// POST request
$result = LaravelCockpit::post('/path/to/resource', ['email' => 'john.doe@example.org']);

// DELETE request
$result = LaravelCockpit::delete('/path/to/resource');
```

### Without cache

[](#without-cache)

```
// GET request without caching
$data = LaravelCockpit::getWithoutCache('/path/to/resource');
$data = LaravelCockpit::ignoreCache()->get('/path/to/resource');
```

### Request on specific connection

[](#request-on-specific-connection)

```
$data = LaravelCockpit::connection('secondary')->get('/path/to/resource');
$result = LaravelCockpit::connection('secondary')->post('/path/to/resource');
$result = LaravelCockpit::connection('secondary')->delete('/path/to/resource');
```

### Clear cache

[](#clear-cache)

```
// Clear cache for default connection
LaravelCockpit::flushCache();

// Clear cache for specific connection
LaravelCockpit::connection('secondary')->flushCache();

// Clear cache for all connections
LaravelCockpit::pruneCache();
```

### Storage

[](#storage)

```
$data = LaravelCockpit::get('/path/to/resource');

// Return full url to resource
$avatarUrl = LaravelCockpit::storage($data['avatar'])

// Return full url to resource on specific connection
$avatarUrl = LaravelCockpit::connection('secondary')->storage($data['avatar'])
```

### Ignore cache by URL query

[](#ignore-cache-by-url-query)

In some cases, you may need to bypass the cache for specific Cockpit connections.
For example, during live previews of changes made in Cockpit.

To enable this, set the `COCKPIT_CACHE_IGNORE_SECRET` in your `.env` file:

```
COCKPIT_CACHE_IGNORE_SECRET=xxx-secret-xxx
```

Now, your `Laravel` application will handle requests with the query parameter `?cockpit-cache-ignore=xxx-secret-xxx` and instruct `LaravelCockpit` to skip caching for the connection matching the provided secret:

```
https://example.org/page/cool?cockpit-cache-ignore=xxx-secret-xxx

```

To instruct `LaravelCockpit` to skip caching for multiple connections you should separate `secrets` with comma(`,`) in URL Query.

```
https://example.org/page/cool?cockpit-cache-ignore=xxx-secret-xxx,xxx-secret-secondary-xxx

```

### Clear cache by URL path

[](#clear-cache-by-url-path)

Sometimes, you may need to clear the cache for specific Cockpit connections, such as after making changes to content in Cockpit.

To enable this, set the `COCKPIT_CACHE_CLEAR_SECRET` in your `.env` file:

```
COCKPIT_CACHE_CLEAR_SECRET=xxx-secret-xxx
```

With this configuration, your `Laravel` application will handle requests to the `/cockpit-cache-clear/xxx-secret-xxx` path, instructing `LaravelCockpit` to clear the cache for the matching connection:

```
https://example.org/cockpit-cache-clear/xxx-secret-xxx

```

To clear the cache for multiple connections simultaneously, separate the `secrets` with a comma(`,`) in the URL query:

```
https://example.org/cockpit-cache-clear/xxx-secret-xxx,xxx-secret-secondary-xxx

```

Behavior

- **Browser Request:** After visiting the `/cockpit-cache-clear` path, you will be redirected back to the previous page.
- **AJAX Request:** When making an AJAX request to the `/cockpit-cache-clear` path, a `204 HTTP status` is returned.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Boris](https://github.com/BorisKM)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance52

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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 ~27 days

Recently: every ~47 days

Total

8

Last Release

336d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/986e2df1512e4fe5af8b67a02952ff6640a62ca4d0b96455c679b2a4b1d08940?d=identicon)[BorisKM](/maintainers/BorisKM)

---

Top Contributors

[![BorisKM](https://avatars.githubusercontent.com/u/721288?v=4)](https://github.com/BorisKM "BorisKM (16 commits)")

---

Tags

cockpitcockpit-cmscockpit-packageentrieentrie-cloudlaravellaravel-cockpitlaravelcockpitentrieentrie-cloudlaravel-cockpitcockpit-cmscockpit-package

### Embed Badge

![Health badge](/badges/entrie-cloud-laravel-cockpit/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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