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.
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.
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.
cache()
Get / set the specified cache value.
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.
collect(mixed $value = null)
Create a collection from the given value.
config(array|string|null $key = null, mixed $default = null)
Get / set the specified configuration value.
string
config_path(string $path = '')
Get the configuration path.
cookie(string|null $name = null, string|null $value = null, int $minutes = 0, string|null $path = null, string|null $domain = null, bool|null $secure = null, bool $httpOnly = true, bool $raw = false, string|null $sameSite = null)
Create a new cookie instance.
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.
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
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.
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.
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
lang_path(string $path = '')
Get the path to the language folder.
bool
laravel_cloud()
Determine if the application is running on Laravel Cloud.
mixed
last(array $array)
Get the last element from an array.
logger(string|null $message = null, array $context = [])
Log a debug message to the logs.
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.
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|null $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(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 $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
storage_path(string $path = '')
Get the path to the storage folder.
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.
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.
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.
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.
mixed
with(mixed $value, callable|null $callback = null)
Return the given value, optionally passed through the given callback.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud .