PHP code example of j2nlab / laravel-simple-version

1. Go to this page and download the library: Download j2nlab/laravel-simple-version library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

j2nlab / laravel-simple-version example snippets

 bash
$ php artisan vendor:publish --provider="J2Nlab\SimpleVersion\ServiceProvider"
 php


return array (
  'major' => 0,
  'minor' => 0,
  'patch' => 0,
  'build' => false,
  'commit' => false,
);
 bash
$ php artisan version         
$ php artisan version:major   
$ php artisan version:minor   
$ php artisan version:patch   
$ php artisan version:build   
$ php artisan version:commit  
 bash
$ php artisan version
Version (compact): 1.1.1-11-f44744
Version (full): version 1.1.1 (build: 11) (commit: f44744)
 bash
$ php artisan version
Version (compact): 1.1.1-f44744
Version (full): version 1.1.1 (commit: f44744)
 bash
$ php artisan version
Version (compact): 1.1.1
Version (full): version 1.1.1
 bash
$ php artisan version
Version (compact): 1.1-f44744
Version (full): version 1.1 (commit: f44744)
 bash
$ php artisan version:commit
No commit number!
 bash
$ php artisan version:build
No build number!
 bash
$ php artisan version:patch
New major version: 2
New version: 1.1.2-12-db5a4a
 bash
$ php artisan version:patch
No patch number!
 bash
$ php artisan version:minor
New minor version: 2
New version: 1.2.0-12-db5a4a
 bash
$ php artisan version:major
New major version: 2
New version: 2.0.0-12-db5a4a
 php
$version = version();
 php
$version = version('compact');
$version = version('full');
 php
@version
 php
@version('compact')
@version('full')