Download the PHP package lbausch/build-metadata-laravel without Composer
On this page you can find all versions of the php package lbausch/build-metadata-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package build-metadata-laravel
Build Metadata for Laravel
Save arbitrary build metadata (commit SHA, build date, ...), deploy them along with your application and retrieve them at runtime when required.
- Requirements
- Installation
- Usage
- Configuration
- Saving Build Metadata
- Deployer Recipe
- Using Build Metadata at Runtime
- Callbacks
- beforeCaching
- Events
- CachingBuildMetadata
- CachedBuildMetadata
Requirements
- PHP 8.1+
- Laravel 9+
Installation
Usage
Configuration
If the default configuration doesn't suit your needs, you may publish the configuration file:
Saving Build Metadata
When deploying your application, e.g. utilizing a CI/CD pipeline, the following command writes build metadata to the configured file:
Build metadata are indefinitely cached, so either the application cache needs to be cleared during deployment or the following command may be used:
Deployer Recipe
This package ships with a Deployer recipe which provides tasks to handle the build metadata.
Using Build Metadata at Runtime
In the following example build metadata are retrieved within a view composer.
Callbacks
beforeCaching
This callback is executed before metadata are indefinitely cached and might be used to alter some of the data.
Events
CachingBuildMetadata
This event is dispatched right before build metadata will be cached.
CachedBuildMetadata
This event is dispatched after build metadata were cached. The cached build metadata are available on the event instance.
All versions of build-metadata-laravel with dependencies
illuminate/cache Version >9
illuminate/contracts Version >9
illuminate/support Version >9
nesbot/carbon Version ^2.62