npmweb/laravel-helpers
最新稳定版本:1.0.1
Composer 安装命令:
composer require npmweb/laravel-helpers
包简介
Laravel-specific helper functions.
README 文档
README
Laravel-specific helper functions.
Installation
Add npmweb/laravel-helpers as a requirement to composer.json:
{
"require": {
"npmweb/laravel-helpers": "1.*"
}
}
Update your packages with composer update.
Usage
The following helper methods are loaded by default:
String Helpers
pluralize( $num, $item )- outputs a singular or plural description of a number of items, appropriate to the number. For example, '1 apple' or '2 apples'
Env Helpers
endpoint()- returns the name of the endpoint being accessed, for example 'frontend' or 'backend'. This is not a standard Laravel feature; it's a NpmWeb team convention. You can configure it by settingENDPOINTin your .env file.is_endpoint($endpoint)- returns true if the current endpoint is the specified one. You can also dois_frontend()oris_backend()if you're using either of those two endpoints.is_env()- returns true if the current environment is the specified one, for example 'local' or 'production'. You can also dois_local(),is_dev(),is_test(), oris_production()if you're using one of those standard environments.
License
This code is open-sourced under the MIT license. For more information, see the LICENSE file.
统计信息
- 总下载量: 2.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-08