kodmanyagha/laravel-helpers

Helper functions for Laravel and Lumen frameworks.

11.0.5 2024-08-31 16:43 UTC

README

Total Downloads Latest Stable Version Latest Unstable Version License

Some beautiful functions here. String to Object conversion, make array or object everything, log current file and line number, random date between given dates etc...

Installation

This is classical composer package. You can install with one command line and start to use it:

composer require kodmanyagha/laravel-helpers

Configuration

There isn't any configuration. Just install it.

Available Functions

makeArray($anything)         Make array.
makeObject($anything)        Make object.

stringToObject($string)      String to Object.
objectToString($object)      Object to Json string.

logDebug(...$args)           Log::debug()
logInfo(...$args)            Log::info()
logWarning(...$args)         Log::warn()
logError(...$args)           Log::error()

password()                   Generate password with APP_KEY salt.
printrExit()                 print_r and exit.
println($str)                Print string with PHP_EOL.
mysqlNow()                   Current date and time with Mysql format.
randomDateTime($start, $end)
randomDate($start, $end)