From dc86edd1bbcda0b43ef68874a93e2e22f57a1664 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 29 Jun 2015 13:14:16 -0500 Subject: [PATCH] fix order --- helpers.md | 130 +++++++++++++++++------------------------------------ 1 file changed, 41 insertions(+), 89 deletions(-) diff --git a/helpers.md b/helpers.md index 3cc898f9e56..99f98326f91 100644 --- a/helpers.md +++ b/helpers.md @@ -85,19 +85,12 @@ Laravel includes a variety of "helper" PHP functions. Many of these functions ar [url](#method-url) -### Routes - -
-[get](#method-route-get) -[post](#method-route-post) -[put](#method-route-put) -[patch](#method-route-patch) -[delete](#method-route-delete) -
- ### Miscellaneous
+[auth](#method-auth) +[back](#method-back) +[bcrypt](#method-bcrypt) [config](#method-config) [csrf_field](#method-csrf-field) [csrf_token](#method-csrf-token) @@ -105,16 +98,13 @@ Laravel includes a variety of "helper" PHP functions. Many of these functions ar [elixir](#method-elixir) [env](#method-env) [event](#method-event) +[factory](#method-factory) +[old](#method-old) +[redirect](#method-redirect) [response](#method-response) [value](#method-value) [view](#method-view) [with](#method-with) -[auth](#method-auth) -[redirect](#method-redirect) -[back](#method-back) -[old](#method-old) -[factory](#method-factory) -[bcrypt](#method-bcrypt)
@@ -614,46 +604,29 @@ The `url` function generates a fully qualified URL to the given path: echo url('user/profile', [1]); - -## Routes - - -#### `get()` {#collection-method} - -The `get` function creates a new **GET** route. You can use it as an alternative to the `Route` facade: - - get('/home'); - - -#### `post()` {#collection-method} - -The `post` function creates a new **POST** route. You can use it as an alternative to the `Route` facade: - - post('/users'); - - -#### `put()` {#collection-method} + +## Miscellaneous -The `put` function creates a new **PUT** route. You can use it as an alternative to the `Route` facade: + +#### `auth()` {#collection-method} - put('/users/{id}'); +The `auth` function return an authenticator instance. You may use it instead of the `Auth` facade for convenience: - -#### `patch()` {#collection-method} + $user = auth()->user(); -The `patch` function creates a new **PATCH** route. You can use it as an alternative to the `Route` facade: + +#### `back()` {#collection-method} - patch('/users/{id}'); +The `back()` function generates a redirect response to the uesr's previous location: - -#### `delete()` {#collection-method} + return back(); -The `delete` function creates a new **DELETE** route. You can use it as an alternative to the `Route` facade: + +#### `bcrypt()` {#collection-method} - delete('/users/{id}'); +The `bcrypt` function hashes the given value using Bcrypt. You may use it as an alternative to the `Hash` facade: - -## Miscellaneous + $password = bcrypt('my-secret-password'); #### `config()` {#collection-method} @@ -709,6 +682,27 @@ The `event` function dispatches the given [event](/docs/{{version}}/events) to i event(new UserRegistered($user)); + +#### `factory()` {#collection-method} + +The `factory` function creates a model factory builder for a given class, name, and amount. It can be used while [testing](/docs/{{version}}/testing#model-factories) or [seeding](/docs/{{version}}/seeding#using-model-factories): + + $user = factory('App\User')->make(); + + +#### `old()` {#collection-method} + +The `old` function [retrieves](/docs/{{version}}/requests#retrieving-input) an old input value flashed into the session.: + + $value = old('value'); + + +#### `redirect()` {#collection-method} + +The `redirect` function return an instance of the redirector to do [redirects](/docs/{{version}}/responses#redirects): + + return redirect('/home'); + #### `response()` {#collection-method} @@ -738,45 +732,3 @@ The `view` function retrieves a [view](/docs/{{version}}/views) instance: The `with` function return the value it is given. This function is primarily useful for method chaining where it would otherwise be impossible: $value = with(new Foo)->work(); - - -#### `auth()` {#collection-method} - -The `auth` function return the available auth instance. You can use it instead of the `Auth` facade for convenience: - - $user = auth()->user(); - - -#### `redirect()` {#collection-method} - -The `redirect` function return an instance of the redirector to do [redirects](/docs/{{version}}/responses#redirects): - - return redirect('/home'); - - -#### `back()` {#collection-method} - -The `back()` function redirects the user to the previous location, this is the simplest method: - - return back(); - - -#### `old()` {#collection-method} - -The `old` function [retrieves](/docs/{{version}}/requests#retrieving-input) an old input value flashed into the session.: - - $value = old('value'); - - -#### `factory()` {#collection-method} - -The `factory` function creates a model factory builder for a given class, name, and amount. It can be used while [testing](/docs/{{version}}/testing#model-factories) or [seeding](/docs/{{version}}/seeding#using-model-factories): - - $user = factory('App\User')->make(); - - -#### `bcrypt()` {#collection-method} - -The `bcrypt` function hash a given value. You can use it as an alternative to the `Hash` facade. See [hashing](/docs/{{version}}/hashing) for more: - - $password = bcrypt('my-secret-password'); \ No newline at end of file