Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hnhdigital-os/laravel-git-info
Provides a wrapper for getting info from GIT.
https://github.com/hnhdigital-os/laravel-git-info
Last synced: 15 days ago
JSON representation
Provides a wrapper for getting info from GIT.
- Host: GitHub
- URL: https://github.com/hnhdigital-os/laravel-git-info
- Owner: hnhdigital-os
- License: mit
- Created: 2016-08-13T13:58:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-28T13:35:28.000Z (about 2 years ago)
- Last Synced: 2024-03-15T07:21:44.674Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# GIT Info
This package has been developed by H&H|Digital, an Australian botique developer. Visit us at [hnh.digital](http://hnh.digital).
[![Latest Stable Version](https://poser.pugx.org/hnhdigital-os/laravel-git-info/v/stable.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info) [![Total Downloads](https://poser.pugx.org/hnhdigital-os/laravel-git-info/downloads.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info) [![Latest Unstable Version](https://poser.pugx.org/hnhdigital-os/laravel-git-info/v/unstable.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info) [![License](https://poser.pugx.org/hnhdigital-os/laravel-git-info/license.svg)](https://packagist.org/packages/hnhdigital-os/laravel-git-info)
[![Build Status](https://travis-ci.org/hnhdigital-os/laravel-git-info.svg?branch=master)](https://travis-ci.org/hnhdigital-os/laravel-git-info) [![StyleCI](https://styleci.io/repos/65619816/shield?branch=master)](https://styleci.io/repos/65619816)
Provides a wrapper for getting info from GIT.
## Install
Via composer:
`$ composer require hnhdigital-os/laravel-git-info ~1.0`
### Laravel configuration
Enable the facade by editing config/app.php:
```php
'aliases' => [
...
'Git' => Bluora\LaravelGitInfo\Facade::class,
...
];
```The service provider will autoload from Laravel 5.5.
To enable the service provider in versions prior to Laravel 5.4, edit the config/app.php:
Enable the service provider by editing config/app.php:
```php
'providers' => [
...
Bluora\LaravelGitInfo\ServiceProvider::class,
...
];
```## Usage
### Laravel
Current version. Eg 'de83088-dirty'.
```php
echo Git::version();
```Current branch. Eg 'master'.
```php
echo Git::branch();
```Current total commits. Eg 7.
```php
echo Git::commits();
```Commit difference between current branch and master.
Optional arguments include specifying a branch and returning a text version.
```php
echo Git::commitsBehind($branch = 'master', $return_text = true);
```Show the status of the submodules.
```php
echo Git::submoduleStatus();
```### PHP
```php
use Bluora\LaravelGitInfo\GitInfo;echo (new GitInfo())->version();
```## Contributing
Please see [CONTRIBUTING](https://github.com/hnhdigital-os/laravel-git-info/blob/master/CONTRIBUTING.md) for details.
## Credits
* [Rocco Howard](https://github.com/therocis)
* [All Contributors](https://github.com/hnhdigital-os/laravel-git-info/contributors)## License
The MIT License (MIT). Please see [License File](https://github.com/hnhdigital-os/laravel-git-info/blob/master/LICENSE) for more information.