LaravelInput

Summary

No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A
File
input.php
Package
Default
Class hierarchy
LaravelInput

Tags

None found

Constants

old_input

old_input

The key used to store old input in the session.

Tags

None found

Properties

$json

$json : object

The JSON payload for applications using Backbone.js or similar.

Type

object

Tags

None found

Methods

all()

all() : array

Get all of the input data for the request, including files.

Returns

array

static

Tags

None found

has()

has(string  $key) : boolean

Determine if the input data contains an item.

If the input item is an empty string, false will be returned.

Parameters

string $key

Returns

boolean

static

Tags

None found

get()

get(string  $key = null, mixed  $default = null) : mixed

Get an item from the input data.

This method is used for all request verbs (GET, POST, PUT, and DELETE).

// Get the "email" item from the input array $email = Input::get('email');

// Return a default value if the specified item doesn't exist
$email = Input::get('name', 'Taylor');

Parameters

string $key
mixed $default

Returns

mixed

static

Tags

None found

query()

query(string  $key = null, mixed  $default = null) : mixed

Get an item from the query string.

// Get the "email" item from the query string $email = Input::query('email');

// Return a default value if the specified item doesn't exist
$email = Input::query('name', 'Taylor');

Parameters

string $key
mixed $default

Returns

mixed

static

Tags

None found

json()

json(boolean  $as_array = false) : object

Get the JSON payload for the request.

Parameters

boolean $as_array

Returns

object

static

Tags

None found

only()

only(array  $keys) : array

Get a subset of the items from the input data.

// Get only the email from the input data $value = Input::only('email');

// Get only the username and email from the input data
$input = Input::only(array('username', 'email'));

Parameters

array $keys

Returns

array

static

Tags

None found

except()

except(array  $keys) : array

Get all of the input data except for a specified array of items.

// Get all of the input data except for username $input = Input::except('username');

// Get all of the input data except for username and email
$input = Input::except(array('username', 'email'));

Parameters

array $keys

Returns

array

static

Tags

None found

had()

had(string  $key) : boolean

Determine if the old input data contains an item.

Parameters

string $key

Returns

boolean

static

Tags

None found

old()

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

Get input data from the previous request.

// Get the "email" item from the old input $email = Input::old('email');

// Return a default value if the specified item doesn't exist
$email = Input::old('name', 'Taylor');

Parameters

string $key
mixed $default

Returns

string

static

Tags

None found

file()

file(string  $key = null, mixed  $default = null) : \Laravel\UploadedFile

Get an item from the uploaded file data.

// Get the array of information for the "picture" upload $picture = Input::file('picture');

Parameters

string $key
mixed $default

Returns

LaravelUploadedFile

static

Tags

None found

has_file()

has_file(string  $key) : boolean

Determine if the uploaded data contains a file.

Parameters

string $key

Returns

boolean

static

Tags

None found

upload()

upload(string  $key, string  $directory, string  $name = null) : \Laravel\Symfony\Component\HttpFoundation\File\File

Move an uploaded file to permanent storage.

This method is simply a convenient wrapper around move_uploaded_file.

// Move the "picture" file to a new permanent location on disk Input::upload('picture', 'path/to/photos', 'picture.jpg');

Parameters

string $key
string $directory
string $name

Returns

LaravelSymfonyComponentHttpFoundationFileFile

static

Tags

None found

flash()

flash(string  $filter = null, array  $keys = array()) : void

Flash the input for the current request to the session.

// Flash all of the input to the session Input::flash();

// Flash only a few input items to the session
Input::flash('only', array('name', 'email'));

// Flash all but a few input items to the session
Input::flash('except', array('password', 'social_number'));

Parameters

string $filter
array $keys

static

Tags

None found

flush()

flush() : void

Flush all of the old input from the session.

static

Tags

None found

merge()

merge(array  $input) : void

Merge new input into the current request's input array.

Parameters

array $input

static

Tags

None found

replace()

replace(array  $input) : void

Replace the input for the current request.

Parameters

array $input

static

Tags

None found

clear()

clear() : void

Clear the input for the current request.

static

Tags

None found