Download the PHP package entrie-cloud/laravel-cockpit without Composer
On this page you can find all versions of the php package entrie-cloud/laravel-cockpit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download entrie-cloud/laravel-cockpit
More information about entrie-cloud/laravel-cockpit
Files in entrie-cloud/laravel-cockpit
Package laravel-cockpit
Short Description Integrates Cockpit CMS with Laravel with caching.
License MIT
Homepage https://github.com/entrie-cloud/laravel-cockpit
Informations about the package laravel-cockpit
Laravel Cockpit Integration Package
A Laravel package designed to seamlessly integrate with Cockpit, providing tools to interact with its API, manage connections, and improve performance with advanced caching mechanisms.
Installation
You can install the package via composer:
Env variables to work out of the box:
You can publish the config file with:
This is the contents of the published config file:
Usage
Basic usage
Without cache
Request on specific connection
Clear cache
Storage
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:
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:
To instruct LaravelCockpit
to skip caching for multiple connections you should separate secrets
with comma(,
) in URL Query.
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:
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:
To clear the cache for multiple connections simultaneously, separate the secrets
with a comma(,
) in the URL query:
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, a204 HTTP status
is returned.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Boris
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-cockpit with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0