Package Data | |
---|---|
Maintainer Username: | mnabialek |
Maintainer Contact: | dev@nabialek.org (Marcin Nabiałek) |
Package Create Date: | 2018-01-07 |
Package Last Update: | 2024-03-26 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-15 15:10:48 |
Package Statistics | |
---|---|
Total Downloads: | 547,648 |
Monthly Downloads: | 8,081 |
Daily Downloads: | 18 |
Total Stars: | 6 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
This package let you verify whether current application is Laravel
or Lumen
, get application version and verify whether application is minimum at given version string.
Run
composer require mnabialek/laravel-version
in console to install this module
That's it! Installation is complete. You don't need to adjust any config or install service providers.
Just run:
$version = app()->make(\Mnabialek\LaravelVersion\Version);
(you can obviously use dependency injection) and then use one of available methods for example like this
$result = $version->isLaravel();
or
if ($version->isLaravel()) {
// do something
}
isLaravel()
- verify whether application is Laravel (true for Laravel, false for Lumen)isLumen()
- verify whether application is Lumen (true for Lumen, false for Laravel)full()
- get full version string (keep in mind for Lumen it can be for example: 'Lumen (5.5.2) (Laravel Components 5.5.*)')get()
- get version (for Both Laravel and Lumen it will contain only version number for example
5.5.2)min($checkedVersion)
- verify whether application is minimum at given version. As
$checkedVersion
you should pass version you want to verify for example 5.5 or 5.5.21This package is licenced under the MIT license