2017 © Pedro Peláez
 

package helpers

Set of helpers to simplify the workflow

image

grooveland/helpers

Set of helpers to simplify the workflow

  • Thursday, July 26, 2018
  • by grooveland
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel settings wrapper

This package allows you to manage settings in a database., (*1)

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

Installation

Laravel

This package can be used in Laravel 5.4 or higher., (*3)

You can install via composer:, (*4)

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:, (*5)

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

Usage

this is a list of the default Helpers, (*6)

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., (*7)

Security

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

Credits

License

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

The Versions

26/07 2018

dev-master

9999999-dev

Set of helpers to simplify the workflow

  Sources   Download

MIT

The Requires

 

by venespana

26/07 2018

v1.0

1.0.0.0

Set of helpers to simplify the workflow

  Sources   Download

MIT

The Requires

 

by venespana