ryanxedi/git-info
最新稳定版本:v1.0.1
Composer 安装命令:
composer require ryanxedi/git-info
包简介
Access your local git branch information
README 文档
README
About gitInfo
gitInfo is a simple tool to retrieve the current branch or hash of your Laravel project:
Getting Started
Pull in the package composer require ryanxedi/git-info
Make this available globally:
Add this to the bottom of your aliases array in config/app.php
'gitInfo' => ryanxedi\gitInfo\gitInfo::class,
Usage
To return your current branch
gitInfo::branch()
To return your current branch's hash
gitInfo::hash()
Example
Try this example blade code snippet:
Add the font-awesome CDN to your HTML header section:
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" rel="stylesheet" />
Presumably, you don't want this to appear in your production environment.
You can wrap this in an @if() statement in your footer
@if (env('APP_ENV') != 'production')
<i class="fa-solid fa-code-branch"></i> {{ gitInfo::branch() }}
@endif
Update 'production' to whatever you call your production environment in you .env file
License
gitInfo is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-05