Namespaces

Functions

string|array|null
__(string|null $key = null, array $replace = [], string|null $locale = null)

Translate the given message.

never
abort(Response|Responsable|int $code, string $message = '', array $headers = [])

Throw an HttpException with the given data.

void
abort_if(bool $boolean, Response|Responsable|int $code, string $message = '', array $headers = [])

Throw an HttpException with the given data if the given condition is true.

void
abort_unless(bool $boolean, Response|Responsable|int $code, string $message = '', array $headers = [])

Throw an HttpException with the given data unless the given condition is true.

string
action(string|array $name, mixed $parameters = [], bool $absolute = true)

Generate the URL to a controller action.

mixed|Application
app(string|null $abstract = null, array $parameters = [])

Get the available container instance.

string
app_path(string $path = '')

Get the path to the application folder.

array
append_config(array $array)

Assign high numeric IDs to a config item to force appending.

array
array_add(array $array, string $key, mixed $value)
deprecated

Add an element to an array using "dot" notation if it doesn't exist.

array
array_collapse(array $array)
deprecated

Collapse an array of arrays into a single array.

array
array_divide(array $array)
deprecated

Divide an array into two arrays. One with keys and the other with values.

array
array_dot(array $array, string $prepend = '')
deprecated

Flatten a multi-dimensional associative array with dots.

array
array_except(array $array, array|string $keys)
deprecated

Get all of the given array except for a specified array of keys.

mixed
array_first(array $array, callable $callback = null, mixed $default = null)
deprecated

Return the first element in an array passing a given truth test.

array
array_flatten(array $array, int $depth = INF)
deprecated

Flatten a multi-dimensional array into a single level.

void
array_forget(array $array, array|string $keys)
deprecated

Remove one or many array items from a given array using "dot" notation.

mixed
array_get(ArrayAccess|array $array, string $key, mixed $default = null)
deprecated

Get an item from an array using "dot" notation.

bool
array_has(ArrayAccess|array $array, string|array $keys)
deprecated

Check if an item or items exist in an array using "dot" notation.

mixed
array_last(array $array, callable $callback = null, mixed $default = null)
deprecated

Return the last element in an array passing a given truth test.

array
array_only(array $array, array|string $keys)
deprecated

Get a subset of the items from the given array.

array
array_pluck(array $array, string|array $value, string|array|null $key = null)
deprecated

Pluck an array of values from an array.

array
array_prepend(array $array, mixed $value, mixed $key = null)
deprecated

Push an item onto the beginning of an array.

mixed
array_pull(array $array, string $key, mixed $default = null)
deprecated

Get a value from the array, and remove it.

mixed
array_random(array $array, int|null $num = null)
deprecated

Get a random value from an array.

array
array_set(array $array, string $key, mixed $value)
deprecated

Set an array item to a given value using "dot" notation.

array
array_sort(array $array, callable|string|null $callback = null)
deprecated

Sort the array by the given callback or attribute name.

array
array_sort_recursive(array $array)
deprecated

Recursively sort an array by keys and values.

array
array_where(array $array, callable $callback)
deprecated

Filter the array using the given callback.

array
array_wrap(mixed $value)
deprecated

If the given value is not an array, wrap it in one.

string
asset(string $path, bool|null $secure = null)

Generate an asset path for the application.

auth(string|null $guard = null)

Get the available auth instance.

back(int $status = 302, array $headers = [], mixed $fallback = false)

Create a new redirect response to the previous location.

string
base_path(string $path = '')

Get the path to the base of the install.

string
bcrypt(string $value, array $options = [])

Hash the given value against the bcrypt algorithm.

bool
blank(mixed $value)

Determine if the given value is "blank".

broadcast(mixed|null $event = null)

Begin broadcasting an event.

mixed|CacheManager
cache()

Get / set the specified cache value.

string
camel_case(string $value)
deprecated

Convert a value to camel case.

string
class_basename(string|object $class)

Get the class "basename" of the given object / class.

array
class_uses_recursive(object|string $class)

Returns all traits used by a class, its parent classes and trait of their traits.

TValue>
collect(TValue>|TValue>|null $value = null)

Create a collection from the given value.

mixed|Repository
config(array|string|null $key = null, mixed $default = null)

Get / set the specified configuration value.

string
config_path(string $path = '')

Get the configuration path.

csrf_field()

Generate a CSRF token form field.

string
csrf_token()

Get the CSRF token value.

mixed
data_fill(mixed $target, string|array $key, mixed $value)

Fill in data where it's missing.

mixed
data_get(mixed $target, string|array|int|null $key, mixed $default = null)

Get an item from an array or object using "dot" notation.

mixed
data_set(mixed $target, string|array $key, mixed $value, bool $overwrite = true)

Set an item on an array or object using dot notation.

string
database_path(string $path = '')

Get the database path.

void
dd(mixed ...$args)

Dump the passed variables and end the script.

mixed
decrypt(string $value, bool $unserialize = true)

Decrypt the given value.

dispatch(mixed $job)

Dispatch a job to its appropriate handler.

mixed
dispatch_now(mixed $job, mixed $handler = null)
deprecated

Dispatch a command to its appropriate handler in the current process.

mixed
dispatch_sync(mixed $job, mixed $handler = null)

Dispatch a command to its appropriate handler in the current process.

string
e(DeferringDisplayableValue|Htmlable|string|null $value, bool $doubleEncode = true)

Encode HTML special characters in a string.

string
elixir(string $file, string $buildDirectory = 'build')
deprecated

Get the path to a versioned Elixir file.

string
encrypt(mixed $value, bool $serialize = true)

Encrypt the given value.

bool
ends_with(string $haystack, string|array $needles)
deprecated

Determine if a given string ends with a given substring.

mixed
env(string $key, mixed $default = null)

Gets the value of an environment variable.

array|null
event(...$args)

Dispatch an event and call the listeners.

FactoryBuilder
factory(string $class, int $amount = null)

Create a model factory builder for a given class and amount.

bool
filled(mixed $value)

Determine if a value is "filled".

mixed
head(array $array)

Get the first element of an array. Useful for method chaining.

void
info(string $message, array $context = [])

Write some information to the log.

string
kebab_case(string $value)
deprecated

Convert a string to kebab case.

string
lang_path(string $path = '')

Get the path to the language folder.

mixed
last(array $array)

Get the last element from an array.

LogManager|null
logger(string|null $message = null, array $context = [])

Log a debug message to the logs.

LogManager|LoggerInterface
logs(string|null $driver = null)

Get a log driver instance.

method_field(string $method)

Generate a form field to spoof the HTTP verb used by forms.

HtmlString|string
mix(string $path, string $manifestDirectory = '')

Get the path to a versioned Mix file.

now(DateTimeZone|string|null $tz = null)

Create a new Carbon instance for the current time.

mixed
object_get(object $object, string|null $key, mixed $default = null)

Get an item from an object using "dot" notation.

mixed
old(string|null $key = null, mixed $default = null)

Retrieve an old input item.

mixed
optional(mixed $value = null, callable $callback = null)

Provide access to optional objects.

mixed
policy(object|string $class)

Get a policy instance for a given class.

string
preg_replace_array(string $pattern, array $replacements, string $subject)

Replace a given pattern with each value in the array in sequentially.

string
public_path(string $path = '')

Get the path to the public folder.

redirect(string|null $to = null, int $status = 302, array $headers = [], bool|null $secure = null)

Get an instance of the redirector.

void
report(Throwable|string $exception)

Report an exception.

Request|string|array|null
request(array|string|null $key = null, mixed $default = null)

Get an instance of the current request or an input item from the request.

mixed
rescue(callable $callback, mixed $rescue = null, bool $report = true)

Catch a potential exception and return a default value.

mixed
resolve(string $name, array $parameters = [])

Resolve a service from the container.

string
resource_path(string $path = '')

Get the path to the resources folder.

response(View|string|array|null $content = '', int $status = 200, array $headers = [])

Return a new response from the application.

mixed
retry(int|array $times, callable $callback, int|Closure $sleepMilliseconds = 0, callable|null $when = null)

Retry an operation a given number of times.

string
route(array|string $name, mixed $parameters = [], bool $absolute = true)

Generate the URL to a named route.

string
secure_asset(string $path)

Generate an asset path for the application.

string
secure_url(string $path, mixed $parameters = [])

Generate a HTTPS url for the application.

session(array|string|null $key = null, mixed $default = null)

Get / set the specified session value.

string
snake_case(string $value, string $delimiter = '_')
deprecated

Convert a string to snake case.

bool
starts_with(string $haystack, string|array $needles)
deprecated

Determine if a given string starts with a given substring.

string
storage_path(string $path = '')

Get the path to the storage folder.

Stringable|mixed
str(string|null $string = null)

Get a new stringable object from the given string.

string
str_after(string $subject, string $search)
deprecated

Return the remainder of a string after a given value.

string
str_before(string $subject, string $search)
deprecated

Get the portion of a string before a given value.

bool
str_contains(string $haystack, string|array $needles)
deprecated

Determine if a given string contains a given substring.

string
str_finish(string $value, string $cap)
deprecated

Cap a string with a single instance of a given value.

bool
str_is(string|array $pattern, string $value)
deprecated

Determine if a given string matches a given pattern.

string
str_limit(string $value, int $limit = 100, string $end = '...')
deprecated

Limit the number of characters in a string.

string
str_plural(string $value, int $count = 2)
deprecated

Get the plural form of an English word.

string
str_random(int $length = 16)
deprecated

Generate a more truly "random" alpha-numeric string.

string
str_replace_array(string $search, array $replace, string $subject)
deprecated

Replace a given value in the string sequentially with an array.

string
str_replace_first(string $search, string $replace, string $subject)
deprecated

Replace the first occurrence of a given value in the string.

string
str_replace_last(string $search, string $replace, string $subject)
deprecated

Replace the last occurrence of a given value in the string.

string
str_singular(string $value)
deprecated

Get the singular form of an English word.

string
str_slug(string $title, string $separator = '-', string $language = 'en')
deprecated

Generate a URL friendly "slug" from a given string.

string
str_start(string $value, string $prefix)
deprecated

Begin a string with a single instance of a given value.

string
studly_case(string $value)
deprecated

Convert a value to studly caps case.

mixed
tap(mixed $value, callable|null $callback = null)

Call the given Closure with the given value then return the value.

mixed
throw_if(mixed $condition, Throwable|string $exception = 'RuntimeException', mixed ...$parameters)

Throw the given exception if the given condition is true.

mixed
throw_unless(mixed $condition, Throwable|string $exception = 'RuntimeException', mixed ...$parameters)

Throw the given exception unless the given condition is true.

string
title_case(string $value)
deprecated

Convert a value to title case.

to_route(string $route, mixed $parameters = [], int $status = 302, array $headers = [])

Create a new redirect response to a named route.

today(DateTimeZone|string|null $tz = null)

Create a new Carbon instance for the current date.

array
trait_uses_recursive(string $trait)

Returns all traits used by a trait and its traits.

Translator|string|array|null
trans(string|null $key = null, array $replace = [], string|null $locale = null)

Translate the given message.

string
trans_choice(string $key, Countable|int|array $number, array $replace = [], string|null $locale = null)

Translates the given message based on a count.

mixed|null
transform(mixed $value, callable $callback, mixed $default = null)

Transform the given value if it is present.

UrlGenerator|string
url(string|null $path = null, mixed $parameters = [], bool|null $secure = null)

Generate a url for the application.

validator(array $data = [], array $rules = [], array $messages = [], array $customAttributes = [])

Create a new Validator instance.

mixed
value(mixed $value, ...$args)

Return the default value of the given value.

view(string|null $view = null, Arrayable|array $data = [], array $mergeData = [])

Get the evaluated view contents for the given view.

bool
windows_os()

Determine whether the current environment is Windows based.

TValue
with(TValue $value, callable $callback = null)

Return the given value, optionally passed through the given callback.