Properties

$labels

$labels : array

All of the label names that have been created.

Type

array

Tags

None found

$macros

$macros : array

The registered custom macros.

Type

array

Tags

None found

Methods

macro()

macro(string  $name, \Laravel\Closure  $macro) : void

Registers a custom macro.

Parameters

string $name
LaravelClosure $macro

static

Tags

None found

open()

open(string  $action = null, string  $method = 'POST', array  $attributes = array(), boolean  $https = null) : string

Open a HTML form.

// Open a "POST" form to the current request URI echo Form::open();

// Open a "POST" form to a given URI
echo Form::open('user/profile');

// Open a "PUT" form to a given URI
echo Form::open('user/profile', 'put');

// Open a form that has HTML attributes
echo Form::open('user/profile', 'post', array('class' => 'profile'));

Parameters

string $action
string $method
array $attributes
boolean $https

Returns

string

static

Tags

None found

open_secure()

open_secure(string  $action = null, string  $method = 'POST', array  $attributes = array()) : string

Open a HTML form with a HTTPS action URI.

Parameters

string $action
string $method
array $attributes

Returns

string

static

Tags

None found

open_for_files()

open_for_files(string  $action = null, string  $method = 'POST', array  $attributes = array(), boolean  $https = null) : string

Open a HTML form that accepts file uploads.

Parameters

string $action
string $method
array $attributes
boolean $https

Returns

string

static

Tags

None found

open_secure_for_files()

open_secure_for_files(string  $action = null, string  $method = 'POST', array  $attributes = array()) : string

Open a HTML form that accepts file uploads with a HTTPS action URI.

Parameters

string $action
string $method
array $attributes

Returns

string

static

Tags

None found

close()

close() : string

Close a HTML form.

Returns

string

static

Tags

None found

token()

token() : string

Generate a hidden field containing the current CSRF token.

Returns

string

static

Tags

None found

label()

label(string  $name, string  $value, array  $attributes = array(),   $escape_html = true) : string

Create a HTML label element.

// Create a label for the "email" input element echo Form::label('email', 'E-Mail Address');

Parameters

string $name
string $value
array $attributes
$escape_html

Returns

string

static

Tags

None found

input()

input(string  $type, string  $name, mixed  $value = null, array  $attributes = array()) : string

Create a HTML input element.

// Create a "text" input element named "email" echo Form::input('text', 'email');

// Create an input element with a specified default value
echo Form::input('text', 'email', 'example@gmail.com');

Parameters

string $type
string $name
mixed $value
array $attributes

Returns

string

static

Tags

None found

text()

text(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML text input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

password()

password(string  $name, array  $attributes = array()) : string

Create a HTML password input element.

Parameters

string $name
array $attributes

Returns

string

static

Tags

None found

hidden()

hidden(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML hidden input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

search()

search(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML search input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

email()

email(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML email input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

telephone()

telephone(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML telephone input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

url()

url(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML URL input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

number()

number(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML number input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

date()

date(string  $name, string  $value = null, array  $attributes = array()) : string

Create a HTML date input element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

file()

file(string  $name, array  $attributes = array()) : string

Create a HTML file input element.

Parameters

string $name
array $attributes

Returns

string

static

Tags

None found

textarea()

textarea(string  $name, string  $value = '', array  $attributes = array()) : string

Create a HTML textarea element.

Parameters

string $name
string $value
array $attributes

Returns

string

static

Tags

None found

select()

select(string  $name, array  $options = array(), string  $selected = null, array  $attributes = array()) : string

Create a HTML select element.

// Create a HTML select element filled with options echo Form::select('sizes', array('S' => 'Small', 'L' => 'Large'));

// Create a select element with a default selected value
echo Form::select('sizes', array('S' => 'Small', 'L' => 'Large'), 'L');

Parameters

string $name
array $options
string $selected
array $attributes

Returns

string

static

Tags

None found

checkbox()

checkbox(string  $name, string  $value = 1, boolean  $checked = false, array  $attributes = array()) : string

Create a HTML checkbox input element.

// Create a checkbox element echo Form::checkbox('terms', 'yes');

// Create a checkbox that is selected by default
echo Form::checkbox('terms', 'yes', true);

Parameters

string $name
string $value
boolean $checked
array $attributes

Returns

string

static

Tags

None found

radio()

radio(string  $name, string  $value = null, boolean  $checked = false, array  $attributes = array()) : string

Create a HTML radio button input element.

// Create a radio button element echo Form::radio('drinks', 'Milk');

// Create a radio button that is selected by default
echo Form::radio('drinks', 'Milk', true);

Parameters

string $name
string $value
boolean $checked
array $attributes

Returns

string

static

Tags

None found

submit()

submit(string  $value = null, array  $attributes = array()) : string

Create a HTML submit input element.

Parameters

string $value
array $attributes

Returns

string

static

Tags

None found

reset()

reset(string  $value = null, array  $attributes = array()) : string

Create a HTML reset input element.

Parameters

string $value
array $attributes

Returns

string

static

Tags

None found

image()

image(string  $url, string  $name = null, array  $attributes = array()) : string

Create a HTML image input element.

// Create an image input element echo Form::image('img/submit.png');

Parameters

string $url
string $name
array $attributes

Returns

string

static

Tags

None found

button()

button(string  $value = null, array  $attributes = array()) : string

Create a HTML button element.

Parameters

string $value
array $attributes

Returns

string

static

Tags

None found

__callStatic()

__callStatic(string  $method, array  $parameters) : mixed

Dynamically handle calls to custom macros.

Parameters

string $method
array $parameters

Returns

mixed

static

Tags

None found

method()

method(string  $method) : string

Determine the appropriate request method to use for a form.

Parameters

string $method

Returns

string

static

Tags

None found

action()

action(string  $action, boolean  $https) : string

Determine the appropriate action parameter to use for a form.

If no action is specified, the current request URI will be used.

Parameters

string $action
boolean $https

Returns

string

static

Tags

None found

optgroup()

optgroup(array  $options, string  $label, string  $selected) : string

Create a HTML select element optgroup.

Parameters

array $options
string $label
string $selected

Returns

string

static

Tags

None found

option()

option(string  $value, string  $display, string  $selected) : string

Create a HTML select element option.

Parameters

string $value
string $display
string $selected

Returns

string

static

Tags

None found

checkable()

checkable(string  $type, string  $name, string  $value, boolean  $checked, array  $attributes) : string

Create a checkable input element.

Parameters

string $type
string $name
string $value
boolean $checked
array $attributes

Returns

string

static

Tags

None found

id()

id(string  $name, array  $attributes) : mixed

Determine the ID attribute for a form element.

Parameters

string $name
array $attributes

Returns

mixed

static

Tags

None found