Download the PHP package illuminated/helper-functions without Composer
On this page you can find all versions of the php package illuminated/helper-functions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download illuminated/helper-functions
More information about illuminated/helper-functions
Files in illuminated/helper-functions
Package helper-functions
Short Description Laravel-specific and pure PHP Helper Functions.
License MIT
Informations about the package helper-functions
Laravel Helper Functions
Laravel-specific and pure PHP Helper Functions.
Laravel | Helper Functions |
---|---|
11.x | Support ☕ |
10.x | 10.x |
9.x | 9.x |
8.x | 8.x |
7.x | 7.x |
6.x | 6.x |
5.8.* | 5.8.* |
5.7.* | 5.7.* |
5.6.* | 5.6.* |
5.5.* | 5.5.* |
5.4.* | 5.4.* |
5.3.* | 5.3.* |
5.2.* | 5.2.* |
5.1.* | 5.1.* |
Usage
-
Install the package via Composer:
- Use any of the provided helper functions:
Available functions
Feel free to contribute.
-
Array
- array_except_value
- multiarray_set
- multiarray_sort_by
-
Artisan
- call_in_background
-
Database
- db_is_sqlite
- db_is_mysql
- db_mysql_now
- db_mysql_variable
-
Date
- to_default_timezone
-
Debug
- backtrace_as_string
- minimized_backtrace_as_string
-
Email
- is_email
- to_rfc2822_email
- to_swiftmailer_emails
- to_symfony_emails
-
Filesystem
- relative_path
-
Format
- get_dump
- format_bytes
- format_xml
-
Json
- is_json
-
System
- is_windows_os
- Xml
- xml_to_array
- array_to_xml
Array
array_except_value()
Remove the given values from the array:
multiarray_set()
Set the value for each item of the multidimensional array using "dot" notation:
multiarray_sort_by()
Sort the multidimensional array by several fields:
Also, you can change the sort order:
Artisan
call_in_background()
Call the given artisan console command in background.
Code execution continues immediately, without waiting for results.
Optional before
and after
sub-commands could be used:
Database
db_is_sqlite()
Check whether the default database connection driver is sqlite
or not:
db_is_mysql()
Check whether the default database connection driver is mysql
or not:
db_mysql_now()
Get the current MySQL datetime:
db_mysql_variable()
Get value of the specified MySQL variable:
Date
to_default_timezone()
Convert the given datetime to the default timezone (see app.timezone
config):
Debug
backtrace_as_string()
Get backtrace without arguments, as a string:
minimized_backtrace_as_string()
Get minimized backtrace, as a string:
is_email()
Check whether the given string is an email address or not:
to_rfc2822_email()
Convert addresses data to RFC 2822 string, suitable for PHP mail() function:
Also, it supports simplified syntax for a single address:
to_swiftmailer_emails()
Convert addresses data to SwiftMailer-suitable format:
Also, it supports simplified syntax for a single address:
to_symfony_emails()
Convert addresses data to Symfony-suitable format:
Also, it supports simplified syntax for a single address:
Filesystem
relative_path()
Get a relative path for the given folders:
You can pass the relative path as a parameter too:
Format
get_dump()
Get a nicely formatted string representation of the variable, using the Symfony VarDumper Component:
format_bytes()
Format bytes into kilobytes, megabytes, gigabytes or terabytes:
format_xml()
Format the given XML string using new lines and indents:
Json
is_json()
Check whether the given value is a valid JSON-encoded string or not:
It returns decoded JSON if you pass true
as a second argument:
System
is_windows_os()
Check whether the operating system is Windows or not:
Xml
xml_to_array()
Convert the given XML to array:
Alternatively, you can pass an instance of the SimpleXMLElement
class instead of a string.
array_to_xml()
Convert the given array to XML string:
Sponsors
License
Laravel Helper Functions is open-sourced software licensed under the MIT license.
All versions of helper-functions with dependencies
ext-dom Version *
ext-simplexml Version *
illuminate/support Version ^10.0
nesbot/carbon Version ^2.67
symfony/filesystem Version ^6.2
symfony/finder Version ^6.2
symfony/process Version ^6.2
symfony/var-dumper Version ^6.2
spatie/array-to-xml Version ^3.0