PHPackages                             redberryproducts/laravel-version - 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. redberryproducts/laravel-version

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

redberryproducts/laravel-version
================================

This is my package laravel-version

v1.0.1(1y ago)0144[3 PRs](https://github.com/RedberryProducts/laravel-version/pulls)MITPHPPHP ^8.2CI passing

Since Sep 20Pushed 1y ago2 watchersCompare

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

READMEChangelog (2)Dependencies (13)Versions (6)Used By (0)

Laravel Version Badge Package
=============================

[](#laravel-version-badge-package)

[![Latest Stable Version](https://camo.githubusercontent.com/b4055a678793632bb67af43e5dbe1ca33079c181389115669052fe5e474f5b9e/68747470733a2f2f706f7365722e707567782e6f72672f726564626572727970726f64756374732f6c61726176656c2d76657273696f6e2f762f737461626c65)](https://packagist.org/packages/redberryproducts/laravel-version)[![Total Downloads](https://camo.githubusercontent.com/27016e9f6cb2eec651ad444ec45d0fdb2d0c9849ca95a2d06bf4c17240bf1832/68747470733a2f2f706f7365722e707567782e6f72672f726564626572727970726f64756374732f6c61726176656c2d76657273696f6e2f646f776e6c6f616473)](https://packagist.org/packages/redberryproducts/laravel-version)[![License](https://camo.githubusercontent.com/ceee029afe5586e0f5d6e36f1222d489474bf791eb7f8c4b23037576b84e4ee2/68747470733a2f2f706f7365722e707567782e6f72672f726564626572727970726f64756374732f6c61726176656c2d76657273696f6e2f6c6963656e7365)](https://packagist.org/packages/redberryproducts/laravel-version)

This Laravel package generates dynamic version badges that reflect the current application version or Composer version based on various conditions. The badges can be easily displayed in your application and updated automatically based on your environment.

Features
--------

[](#features)

- Display the application version from the `.env` file.
- Display the Composer version from `composer.json`.
- Generate dynamic SVG badges to show the versions.
- Customizable routes for accessing version and badge data.

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

[](#installation)

Install the package via Composer:

```
composer require redberryproducts/laravel-version
```

Publish Configuration
---------------------

[](#publish-configuration)

After installation, publish the configuration file:

```
php artisan vendor:publish --tag=laravel-version-config
```

This will create a config/version.php file where you can set your application version:This will create a config/version.php file where you can set your application version:

```
return [
    'app_version' => env('APP_VERSION', 'N/A'),
];
```

Usage
-----

[](#usage)

### Routes

[](#routes)

This package provides two routes for fetching version information and generating badges.

1. Application Version: Retrieves the current version of your application.
    - URL: `/application/version`
    - Controller: `VersionController@index`
    - Returns both the environment version (from .env) and the composer version (from composer.json).
2. Version Badge: Generates an SVG badge with dynamic content based on the requested provider (either composer or env).
    - URL: `/application/version/badge?provider={composer|env}&environment={optional}`
    - Controller: `VersionBadgeController`

### Example Badge

[](#example-badge)

You can include the badge in your application as an SVG by embedding the URL in your frontend or views:

```

```

Blade Views
-----------

[](#blade-views)

The package also comes with two Blade files for rendering the version and badges.

1. `app.blade.php`: Displays both the environment and composer versions using the badge component. ```
    @include('version::badge', ['label' => 'Environment Version', 'version' => $envVersion])
    @include('version::badge', ['label' => 'Composer Version', 'version' => $composerVersion])
    ```
2. `badge.blade.php`: Generates the SVG for the badge based on the label and version provided.

Configuration
-------------

[](#configuration)

The package uses the following environment variable in your `.env` file:

```
APP_VERSION=1.0.0
```

By default, if `APP_VERSION` is not set, it will display N/A.

Customization
-------------

[](#customization)

To customize the badge, you can replace `'badge_blade' => 'version::badge',` in the `config/version.php` file with your custom blade file.

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request or open an issue.

1. Fork the repository.
2. Create a feature branch: `git checkout -b feature-branch`.
3. Commit your changes: `git commit -m 'Add some feature'`.
4. Push to the branch: `git push origin feature-branch`.
5. Open a pull request.

Credits
-------

[](#credits)

- [Nika Jorjoliani](https://github.com/RedberryProducts)
- [All Contributors](../../contributors)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance43

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Total

2

Last Release

574d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/575834382d0d9a2f525665011b42db95bb50b6ed74e4a2dded51a3b77ac85873?d=identicon)[nikajorjika](/maintainers/nikajorjika)

---

Top Contributors

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

---

Tags

laravellaravel versionRedberryProducts

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  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)
