Download the PHP package phannaly/laravel-helpers without Composer

On this page you can find all versions of the php package phannaly/laravel-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-helpers

The PHP helpers function extract from Laravel

Build Status StyleCI

This project is independently you don't need to install anything(composer) unless you want to contribute.

Most of the code extract from Laravel codebase.

Requirements

Setup

You don't need to install by composer if your project doesn't have it.

Just import it manually in src folder.

But If you want to install by composer, please follow command below

composer require phannaly/laravel-helpers

This library will load automatically after you install it. Done!, you are good to go.

Available Methods

Arrays & Objects

Strings

Arrays & Objects

array_add()

The array_add function adds a given key / value pair to an array if the given key doesn't already exist in the array:

array_collapse()

The array_collapse function collapses an array of arrays into a single array:

array_divide()

The array_divide function returns two arrays, one containing the keys, and the other containing the values of the given array:

array_dot()

The array_dot function flattens a multi-dimensional array into a single level array that uses "dot" notation to indicate depth:

array_except()

The array_except function removes the given key / value pairs from an array:

array_first()

The array_first function returns the first element of an array passing a given truth test:

A default value may also be passed as the third parameter to the method. This value will be returned if no value passes the truth test:

array_flatten()

The array_flatten function flattens a multi-dimensional array into a single level array:

array_forget()

The array_forget function removes a given key / value pair from a deeply nested array using "dot" notation:

array_get()

The array_get function retrieves a value from a deeply nested array using "dot" notation:

The array_get function also accepts a default value, which will be returned if the specific key is not found:

array_has()

The array_has function checks whether a given item or items exists in an array using "dot" notation:

array_last()

The array_last function returns the last element of an array passing a given truth test:

A default value may be passed as the third argument to the method. This value will be returned if no value passes the truth test:

array_only()

The array_only function returns only the specified key / value pairs from the given array:

array_pluck()

The array_pluck function retrieves all of the values for a given key from an array:

You may also specify how you wish the resulting list to be keyed:

array_prepend()

The array_prepend function will push an item onto the beginning of an array:

If needed, you may specify the key that should be used for the value:

array_pull()

The array_pull function returns and removes a key / value pair from an array:

A default value may be passed as the third argument to the method. This value will be returned if the key doesn't exist:

array_random()

The array_random function returns a random value from an array:

You may also specify the number of items to return as an optional second argument. Note that providing this argument will return an array, even if only one item is desired:

array_set()

The array_set function sets a value within a deeply nested array using "dot" notation:

array_sort()

The array_sort function sorts an array by its values:

You may also sort the array by the results of the given Closure:

array_sort_recursive()

The array_sort_recursive function recursively sorts an array using the sort function for numeric sub=arrays and ksort for associative sub-arrays:

array_where()

The array_where function filters an array using the given Closure:

array_wrap()

The array_wrap function wraps the given value in an array. If the given value is already an array it will not be changed:

If the given value is null, an empty array will be returned:

data_fill()

The data_fill function sets a missing value within a nested array or object using "dot" notation:

This function also accepts asterisks as wildcards and will fill the target accordingly:

data_get()

The data_get function retrieves a value from a nested array or object using "dot" notation:

The data_get function also accepts a default value, which will be returned if the specified key is not found:

data_set()

The data_set function sets a value within a nested array or object using "dot" notation:

This function also accepts wildcards and will set values on the target accordingly:

By default, any existing values are overwritten. If you wish to only set a value if it doesn't exist, you may pass false as the third argument:

head()

The head function returns the first element in the given array:

last()

The last function returns the last element in the given array:

Strings

camel_case()

The camel_case function converts the given string to camelCase:

ends_with()

The ends_with function determines if the given string ends with the given value:

kebab_case()

The kebab_case function converts the given string to kebab-case:

preg_replace_array()

The preg_replace_array function replaces a given pattern in the string sequentially using an array:

snake_case()

The snake_case function converts the given string to snake_case:

starts_with()

The starts_with function determines if the given string begins with the given value:

str_after()

The str_after function returns everything after the given value in a string:

str_before()

The str_before function returns everything before the given value in a string:

str_contains()

The str_contains function determines if the given string contains the given value (case sensitive):

You may also pass an array of values to determine if the given string contains any of the values:

str_finish()

The str_finish function adds a single instance of the given value to a string if it does not already end with the value:

str_is()

The str_is function determines if a given string matches a given pattern. Asterisks may be used to indicate wildcards:

str_limit()

The str_limit function truncates the given string at the specified length:

You may also pass a third argument to change the string that will be appended to the end:

str_random()

The str_random function generates a random string of the specified length. This function uses PHP's random_bytes function:

str_replace_array()

The str_replace_array function replaces a given value in the string sequentially using an array:

str_replace_first()

The str_replace_first function replaces the first occurrence of a given value in a string:

str_replace_last()

The str_replace_last function replaces the last occurrence of a given value in a string:

str_slug()

The str_slug function generates a URL friendly "slug" from the given string:

str_start()

The str_start function adds a single instance of the given value to a string if it does not already start with the value:

studly_case()

The studly_case function converts the given string to StudlyCase:

title_case()

The title_case function converts the given string to Title Case:

Contributing

Feel free to contribute through PR.

See CODE OF CONDUCT for details.

License

This package operates under the MIT License (MIT). See the LICENSE file for details.


All versions of laravel-helpers with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phannaly/laravel-helpers contains the following files

Loading the files please wait ....