定制 npmweb/laravel-helpers 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 setting ENDPOINT in your .env file.
  • is_endpoint($endpoint) - returns true if the current endpoint is the specified one. You can also do is_frontend() or is_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 do is_local(), is_dev(), is_test(), or is_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

GitHub 信息

  • Stars: 0
  • Watchers: 12
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-08