Download the PHP package ahs-composer/laravel-helpers without Composer
On this page you can find all versions of the php package ahs-composer/laravel-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ahs-composer/laravel-helpers
More information about ahs-composer/laravel-helpers
Files in ahs-composer/laravel-helpers
Download ahs-composer/laravel-helpers
More information about ahs-composer/laravel-helpers
Files in ahs-composer/laravel-helpers
Vendor ahs-composer
Package laravel-helpers
Short Description A collection of helper functions for Laravel
License
Package laravel-helpers
Short Description A collection of helper functions for Laravel
License
Please rate this library. Is it a good library?
Informations about the package laravel-helpers
Laravel Helpers
A collection of helper functions for Laravel, created by Ali Haider.
Installation
You can install this package via Composer. Run the following command in your terminal:
Usage
Autoloading
This package utilizes PSR-4 autoloading, so make sure to add the following line to your composer.json file if it's not already present:
Helper Functions
The package provides the following helper functions:
- slugify($string) : Converts a string into a URL-friendly slug.
- truncate($string, $length = 100, $append = "..."): Truncates a string to a specified length and appends a suffix.
- camelCase($string): Converts a string to camelCase.
- array_flatten($array): Flattens a multi-dimensional array into a single-dimensional array.
- array_key_exists_recursive($key, $array): Checks if a key exists in a multi-dimensional array.
- format_date($date, $format = 'Y-m-d H:i:s'): Formats a date string into a specified format.
- carbon_date($date = null): Returns a Carbon date instance for a given date or the current date.
- current_url(): Returns the current URL.
- url_with_params($url, $params = []): Constructs a URL with query parameters.
- file_size_formatted($path): Formats a file size into a human-readable format.
- env_value($key, $default = null): Retrieves an environment variable's value.
- generate_random_string($length = 16): Generates a random string of a specified length.
Example
Here's an example of how you can use the helper functions:
All versions of laravel-helpers with dependencies
PHP Build Version
Package Version
The package ahs-composer/laravel-helpers contains the following files
Loading the files please wait ...