Facades

This package extends Laravel's framework facades with new useful methods.

Arr

exceptValues

Filter array shorthand by just excluding the values passed as second argument.

Arr::exceptValues([
    "hello" => "world",
    "foo" => "bar"
], "bar");

// ["hello" => "world"]

onlyValues

Filter array shorthand by just including the values passed as second argument.

Arr::onlyValues([
    "hello" => "world",
    "foo" => "bar"
], "world");

// ["hello" => "world"]

query

Write a URL query string from an array.

Collection

toCsv

Converts collection of items to CSV with its headers.

templateJoin

Join items of the collection using a template substitution.

Number

toShort

Get shorter version of a big number if possible.

toByteUnit

Get byte unit version of a number.

Storage

humanSize

Get human readable file size at given path.

Str

parseQuery

Parse a URL query string into an array.

isJsonStructure

Check if string contains a valid JSON structure.

emailDomain

Get domain part from email address.

Last updated