定制 grooveland/helpers 二次开发

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

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

grooveland/helpers

Composer 安装命令:

composer require grooveland/helpers

包简介

Set of helpers to simplify the workflow

README 文档

README

This package allows you to manage settings in a database.

The settings are handled by groups and types of data (string, boolean, integer, double, array)

Installation

Laravel

This package can be used in Laravel 5.4 or higher.

You can install via composer:

composer require grooveland/helpers

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file:

'providers' => [
    // ...
    \Grooveland\Helpers\HelperServiceProvider::class,
];

Usage

this is a list of the default Helpers

Array

/**
 * Transform an stdClass, object with toArray method
 * or simple var into array, the parameter is passed by reference
 *
 * @param &$data
 * @return void
 */
to_array(&$data)

Objects

/**
 * Check if $value is a instance of Eloquent Collection
 *
 * @param any $value
 * @return bool
 */
is_collection($value)

/**
 * Transform an array, object with Object method
 * or simple var into stdClass, the parameter is passed by reference
 *
 * @param $data
 * @return void
 */
to_obj(&$data)

Numbers

/**
 * Format number 
 *
 * @param $number
 * @param string $thousandSeparator
 * @param string $decimalPoint
 * @param int $decimals
 * @return string
 */
format_number($number, string $thousandSeparator = '.', string $decimalPoint = ',', int $decimals = 2)

Strings

/**
 * Truncate a string by a max of chars, optionally can add HTML  entities, preserve tags and add ellipsis
 *
 * @param string $string
 * @param int $max
 * @param int $start
 * @param bool $addHtmlEntities
 * @param bool $cleanTags
 * @param bool $ellipsis
 * @return string
 */
str_truncate(string $string, int $max, int $start = 0, bool $addHtmlEntities = false, bool $cleanTags = true, bool $ellipsis = true) : string

/**
 * Replace the first coincidence in a string
 *
 * @param string $from
 * @param string $to
 * @param string $content
 * @return string
 */
function str_replace_first(string $from, string $to, string $content)

Contributing

Comming soon.

Security

If you discover any security-related issues, please email develop@thegrooveland.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 78
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固