asQuestion()
Apply CLI question styles to text
asQuestion(mixed $data) : mixed
Parameters
- $data : mixed
Apply CLI question styles to text
asQuestion(mixed $data) : mixed
Apply CLI comment styles to text
asComment(mixed $data) : mixed
Apply CLI info styles to text
asInfo(mixed $data) : mixed
Apply CLI error styles to text
asError(mixed $data) : mixed
Output text as a link
asLink(mixed $link, mixed $display) : mixed
Return the leaf auth object
auth() : Auth
Return the leaf csrf object
csrf() : CSRF
Return the leaf date instance
tick([string|null $userDate = null ][, string|null $userTimeZone = null ]) : Date
Return the database object
db([string|null $connection = null ]) : Db
The connection to return db with
Shortcut method for making network requests.
fetch([array<string|int,
mixed>|string $data = null ]) : mixed
The url or request to hit.
Return leaf form object
form() : Form
validator() : mixed
Return the Leaf instance
path(string $path) : Path
Return the Leaf instance
storage() : Storage
Return request or request data
request() : Request
Return response or set response data
response() : Response
Render Inertia page
inertia(string $component[, array<string|int,
mixed> $props = [] ]) : mixed
The component to render.
The props to pass to the component.
Return the Leaf instance
app() : App
Gets the value of an environment variable.
_env(string $key[, mixed $default = null ]) : mixed
Create and send an email
mailer([array<string|int,
mixed> $mail = null ]) : Mail
Note that
\Leaf\Mail\Mailer
should be configured
Get app configuration
AppConfig([mixed $setting = null ]) : mixed
Get paths configuration
PathsConfig([mixed $setting = null ]) : mixed
Get an auth configuration
AuthConfig([mixed $setting = null ]) : mixed
Get view configuration
ViewConfig([mixed $setting = null ]) : mixed
Get database configuration
DatabaseConfig([mixed $setting = null ]) : mixed
Get an auth configuration
CorsConfig([mixed $setting = null ]) : mixed
Get mail configuration
MailConfig([mixed $setting = null ]) : mixed
Get an application configuration
MvcConfig(mixed $appConfig[, mixed $setting = null ]) : mixed
Import an asset
assets([string $assets = '' ]) : mixed
The asset to import
Return a view
view(string $view[, array<string|int,
mixed>|object $data = [] ]) : string
The view to render
The data to pass to the view
Render a view
render(string $view[, array<string|int,
mixed>|object $data = [] ]) : mixed
The view to render
The data to pass to the view
Redirect to a given url
redirect(string $url) : mixed
The url to redirect to
Get a route by name
route() : mixed
Get a route by name
vite(mixed $files[, string $baseDir = 'app/views' ]) : mixed
The base directory to look for the file(s)
Get all app paths
AppPaths([mixed $path = null ][, bool $slash = false ]) : mixed
Config directory path
ConfigPath([mixed $path = '' ]) : string
Commands directory path
CommandsPath([mixed $path = '' ]) : string
Controllers directory path
ControllersPath([mixed $path = '' ]) : string
Database path
DatabasePath([mixed $path = '' ]) : string
Factories directory path
FactoriesPath([mixed $path = '' ]) : string
Helpers directory path
HelpersPath([mixed $path = '' ]) : string
Helpers directory path
LibPath([mixed $path = '' ]) : string
Migrations directory path
MigrationsPath([mixed $path = '' ][, bool $slash = true ]) : string
Models directory path
ModelsPath([mixed $path = '' ]) : string
Public directory path
PublicPath([mixed $path = '' ][, mixed $slash = true ]) : string
Routes directory path
RoutesPath([mixed $path = '' ]) : string
Seeds directory path
SeedsPath([mixed $path = '' ]) : string
Storage directory path
StoragePath([mixed $path = '' ][, bool $slash = false ]) : string
Views directory path
ViewsPath([mixed $path = '' ][, bool $slash = true ]) : string
Return queue object
queue() : Queue
Dispatch a job, batch or a group of jobs
dispatch(array<string|int, mixed>|Dispatchable|string $dispatchable) : mixed
The job, batch or group of jobs to dispatch
Return redis object
redis() : Redis
Return session object
session() : Session
Return flash data/object or set flash data
flash() : Flash
Get a route by name
vite(mixed $files[, string|null $baseDir = null ]) : mixed
The base directory to look for the file(s)