Skip to content

Commit

Permalink
working on middleware docs and updated notes
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jul 12, 2016
1 parent b5e7d71 commit 31e5718
Show file tree
Hide file tree
Showing 34 changed files with 97 additions and 96 deletions.
6 changes: 3 additions & 3 deletions authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ If you wish, you also may add extra conditions to the authentication query in ad
// The user is active, not suspended, and exists.
}

> **Note:** In these examples, `email` is not a required option, it is merely used as an example. You should use whatever column name corresponds to a "username" in your database.
> {note} In these examples, `email` is not a required option, it is merely used as an example. You should use whatever column name corresponds to a "username" in your database.
#### Accessing Specific Guard Instances

Expand Down Expand Up @@ -362,7 +362,7 @@ Next, [register the route middleware](/docs/{{version}}/middleware#registering-m
<a name="resetting-passwords"></a>
## Resetting Passwords

> **Note:** Before using the password reset features of Laravel, your user must use the `Illuminate\Notifications\Notifiable` trait.
> {note} Before using the password reset features of Laravel, your user must use the `Illuminate\Notifications\Notifiable` trait.
<a name="resetting-database"></a>
### Database Considerations
Expand Down Expand Up @@ -398,7 +398,7 @@ After the password is reset, the user will automatically be logged into the appl

protected $redirectTo = '/dashboard';

> **Note:** By default, password reset tokens expire after one hour. You may change this via the password reset `expire` option in your `config/auth.php` file.
> {note} By default, password reset tokens expire after one hour. You may change this via the password reset `expire` option in your `config/auth.php` file.
<a name="password-customization"></a>
### Customization
Expand Down
2 changes: 1 addition & 1 deletion authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ When defining policy methods that will not receive any model instance, such as a

This convention will be respected by the Gate when [checking policy methods](#checking-policies).

> **Note:** All policies are resolved via the Laravel [service container](/docs/{{version}}/container), meaning you may type-hint any needed dependencies in the policy's constructor and they will be automatically injected.
> {note} All policies are resolved via the Laravel [service container](/docs/{{version}}/container), meaning you may type-hint any needed dependencies in the policy's constructor and they will be automatically injected.
#### Intercepting All Checks

Expand Down
8 changes: 4 additions & 4 deletions billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ If you would like to swap plans but skip the trial period on the plan you are sw
<a name="subscription-quantity"></a>
### Subscription Quantity

> **Note:** Subscription quantities are only supported by the Stripe edition of Cashier. Braintree does not have an equivalent to Stripe's "quantity".
> {note} Subscription quantities are only supported by the Stripe edition of Cashier. Braintree does not have an equivalent to Stripe's "quantity".
Sometimes subscriptions are affected by "quantity". For example, your application might charge $10 per month **per user** on an account. To easily increment or decrement your subscription quantity, use the `incrementQuantity` and `decrementQuantity` methods:

Expand Down Expand Up @@ -346,7 +346,7 @@ If you would like to offer trial periods to your customers while still collectin

This method will set the trial period ending date on the subscription record within the database, as well as instruct Stripe / Braintree to not begin billing the customer until after this date.

> **Note:** If the customer's subscription is not cancelled before the trial ending date they will be charged as soon as the trial expires, so you should notify your users of their trial ending date.
> {note} If the customer's subscription is not cancelled before the trial ending date they will be charged as soon as the trial expires, so you should notify your users of their trial ending date.
You may determine if the user is within their trial period using either the `onTrial` method of the user instance, or the `onTrial` method of the subscription instance. The two examples below are essentially identical in purpose:

Expand Down Expand Up @@ -484,7 +484,7 @@ If you have additional Braintree webhook events you would like to handle, simply

### Simple Charge

> **Note:** When using Stripe, the `charge` method accepts the amount you would like to charge in the **lowest denominator of the currency used by your application**. However, when using Braintree, you should pass the full dollar amount to the `charge` method:
> {note} When using Stripe, the `charge` method accepts the amount you would like to charge in the **lowest denominator of the currency used by your application**. However, when using Braintree, you should pass the full dollar amount to the `charge` method:
If you would like to make a "one off" charge against a subscribed customer's credit card, you may use the `charge` method on a billable model instance.

Expand Down Expand Up @@ -524,7 +524,7 @@ The invoice will be charged immediately against the user's credit card. The `inv
'custom-option' => $value,
]);

> **Note:** The `invoiceFor` method will create a Stripe invoice which will retry failed billing attempts. If you do not want invoices to retry failed charges, you will need to close them using the Stripe API after the first failed charge.
> {note} The `invoiceFor` method will create a Stripe invoice which will retry failed billing attempts. If you do not want invoices to retry failed charges, you will need to close them using the Stripe API after the first failed charge.
<a name="invoices"></a>
## Invoices
Expand Down
6 changes: 3 additions & 3 deletions blade.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Of course, you are not limited to displaying the contents of the variables passe

The current UNIX timestamp is {{ time() }}.

> **Note:** Blade `{{ }}` statements are automatically sent through PHP's `htmlentities` function to prevent XSS attacks.
> {note} Blade `{{ }}` statements are automatically sent through PHP's `htmlentities` function to prevent XSS attacks.
#### Blade & JavaScript Frameworks

Expand Down Expand Up @@ -120,7 +120,7 @@ By default, Blade `{{ }}` statements are automatically sent through PHP's `htmle

Hello, {!! $name !!}.

> **Note:** Be very careful when echoing content that is supplied by users of your application. Always use the double curly brace syntax to escape any HTML entities in the content.
> {note} Be very careful when echoing content that is supplied by users of your application. Always use the double curly brace syntax to escape any HTML entities in the content.
<a name="control-structures"></a>
## Control Structures
Expand Down Expand Up @@ -217,7 +217,7 @@ Even though the included view will inherit all data available in the parent view

@include('view.name', ['some' => 'data'])

> **Note:** You should avoid using the `__DIR__` and `__FILE__` constants in your Blade views, since they will refer to the location of the cached view.
> {note} You should avoid using the `__DIR__` and `__FILE__` constants in your Blade views, since they will refer to the location of the cached view.
#### Rendering Views For Collections

Expand Down
2 changes: 1 addition & 1 deletion cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Flushing the cache **does not** respect the cache prefix and will remove all ent
<a name="cache-tags"></a>
## Cache Tags

> **Note:** Cache tags are not supported when using the `file` or `database` cache drivers. Furthermore, when using multiple tags with caches that are stored "forever", performance will be best with a driver such as `memcached`, which automatically purges stale records.
> {note} Cache tags are not supported when using the `file` or `database` cache drivers. Furthermore, when using multiple tags with caches that are stored "forever", performance will be best with a driver such as `memcached`, which automatically purges stale records.
<a name="storing-tagged-cache-items"></a>
### Storing Tagged Cache Items
Expand Down
8 changes: 4 additions & 4 deletions collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ The `forget` method removes an item from the collection by its key:

// ['framework' => 'laravel']

> **Note:** Unlike most other collection methods, `forget` does not return a new modified collection; it modifies the collection it is called on.
> {note} Unlike most other collection methods, `forget` does not return a new modified collection; it modifies the collection it is called on.
<a name="method-forpage"></a>
#### `forPage()` {#collection-method}
Expand Down Expand Up @@ -690,7 +690,7 @@ The `map` method iterates through the collection and passes each value to the gi

// [2, 4, 6, 8, 10]

> **Note:** Like most other collection methods, `map` returns a new collection instance; it does not modify the collection it is called on. If you want to transform the original collection, use the [`transform`](#method-transform) method.
> {note} Like most other collection methods, `map` returns a new collection instance; it does not modify the collection it is called on. If you want to transform the original collection, use the [`transform`](#method-transform) method.
<a name="method-max"></a>
#### `max()` {#collection-method}
Expand Down Expand Up @@ -1193,7 +1193,7 @@ The `toArray` method converts the collection into a plain PHP `array`. If the co
]
*/

> **Note:** `toArray` also converts all of its nested objects to an array. If you want to get the underlying array as is, use the [`all`](#method-all) method instead.
> {note} `toArray` also converts all of its nested objects to an array. If you want to get the underlying array as is, use the [`all`](#method-all) method instead.
<a name="method-tojson"></a>
#### `toJson()` {#collection-method}
Expand Down Expand Up @@ -1221,7 +1221,7 @@ The `transform` method iterates over the collection and calls the given callback

// [2, 4, 6, 8, 10]

> **Note:** Unlike most other collection methods, `transform` modifies the collection itself. If you wish to create a new collection instead, use the [`map`](#method-map) method.
> {note} Unlike most other collection methods, `transform` modifies the collection itself. If you wish to create a new collection instead, use the [`map`](#method-map) method.
<a name="method-union"></a>
#### `union()` {#collection-method}
Expand Down
2 changes: 1 addition & 1 deletion controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ You may still type-hint the `Illuminate\Http\Request` and access your route para
<a name="route-caching"></a>
## Route Caching

> **Note:** Route caching does not work with Closure based routes. To use route caching, you must convert any Closure routes to use controller classes.
> {note} Route caching does not work with Closure based routes. To use route caching, you must convert any Closure routes to use controller classes.
If your application is exclusively using controller based routes, you should take advantage of Laravel's route cache. Using the route cache will drastically decrease the amount of time it takes to register all of your application's routes. In some cases, your route registration may even be up to 100x faster! To generate a route cache, just execute the `route:cache` Artisan command:

Expand Down
2 changes: 1 addition & 1 deletion database.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Lastly, you can commit a transaction via the `commit` method:

DB::commit();

> **Note:** Using the `DB` facade's transaction methods also controls transactions for the [query builder](/docs/{{version}}/queries) and [Eloquent ORM](/docs/{{version}}/eloquent).
> {note} Using the `DB` facade's transaction methods also controls transactions for the [query builder](/docs/{{version}}/queries) and [Eloquent ORM](/docs/{{version}}/eloquent).
<a name="accessing-connections"></a>
## Using Multiple Database Connections
Expand Down
2 changes: 1 addition & 1 deletion eloquent-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ However, collections are much more powerful than arrays and expose a variety of
return $user->name;
});

> **Note:** While most Eloquent collection methods return a new instance of an Eloquent collection, the `pluck`, `keys`, `zip`, `collapse`, `flatten` and `flip` methods return a [base collection](/docs/{{version}}/collections) instance.
> {note} While most Eloquent collection methods return a new instance of an Eloquent collection, the `pluck`, `keys`, `zip`, `collapse`, `flatten` and `flip` methods return a [base collection](/docs/{{version}}/collections) instance.
<a name="available-methods"></a>
## Available Methods
Expand Down
2 changes: 1 addition & 1 deletion eloquent-serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Sometimes you may wish to limit the attributes, such as passwords, that are incl
protected $hidden = ['password'];
}

> **Note:** When hiding relationships, use the relationship's **method** name, not its dynamic property name.
> {note} When hiding relationships, use the relationship's **method** name, not its dynamic property name.
Alternatively, you may use the `visible` property to define a white-list of attributes that should be included in your model's array and JSON representation:

Expand Down
2 changes: 1 addition & 1 deletion eloquent.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ The Eloquent `all` method will return all of the results in the model's table. S
->take(10)
->get();

> **Note:** Since Eloquent models are query builders, you should review all of the methods available on the [query builder](/docs/{{version}}/queries). You may use any of these methods in your Eloquent queries.
> {note} Since Eloquent models are query builders, you should review all of the methods available on the [query builder](/docs/{{version}}/queries). You may use any of these methods in your Eloquent queries.
#### Collections

Expand Down
2 changes: 1 addition & 1 deletion encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For example, we may use the `encrypt` method to encrypt a secret and store it on
}
}

> **Note:** Encrypted values are passed through `serialize` during encryption, which allows for "encryption" of objects and arrays. Thus, non-PHP clients receiving encrypted values will need to `unserialize` the data.
> {note} Encrypted values are passed through `serialize` during encryption, which allows for "encryption" of objects and arrays. Thus, non-PHP clients receiving encrypted values will need to `unserialize` the data.
#### Decrypting A Value

Expand Down
2 changes: 1 addition & 1 deletion filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ When using the `local` or `s3` drivers, you may use the `url` method to get the

$url = Storage::url('file1.jpg');

> **Note:** When using the `local` driver, be sure to [create a symbolic link at `public/storage`](#the-public-disk) which points to the `storage/app/public` directory.
> {note} When using the `local` driver, be sure to [create a symbolic link at `public/storage`](#the-public-disk) which points to the `storage/app/public` directory.
#### File Meta Information

Expand Down
4 changes: 2 additions & 2 deletions homestead.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Laravel Homestead is an official, pre-packaged Vagrant box that provides you a w

Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.0, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.

> **Note:** If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS. If you are using Hyper-V on a UEFI system you may additionally need to disable Hyper-V in order to access VT-x.
> {note} If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS. If you are using Hyper-V on a UEFI system you may additionally need to disable Hyper-V in order to access VT-x.
<a name="included-software"></a>
### Included Software
Expand Down Expand Up @@ -194,7 +194,7 @@ A `homestead` database is configured for both MySQL and Postgres out of the box.

To connect to your MySQL or Postgres database from your host machine via Navicat or Sequel Pro, you should connect to `127.0.0.1` and port `33060` (MySQL) or `54320` (Postgres). The username and password for both databases is `homestead` / `secret`.

> **Note:** You should only use these non-standard ports when connecting to the databases from your host machine. You will use the default 3306 and 5432 ports in your Laravel database configuration file since Laravel is running _within_ the virtual machine.
> {note} You should only use these non-standard ports when connecting to the databases from your host machine. You will use the default 3306 and 5432 ports in your Laravel database configuration file since Laravel is running _within_ the virtual machine.
<a name="adding-additional-sites"></a>
### Adding Additional Sites
Expand Down
4 changes: 2 additions & 2 deletions mail.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Since we are passing an array containing the `user` key in the example above, we

<?php echo $user->name; ?>

> **Note:** A `$message` variable is always passed to e-mail views, and allows the [inline embedding of attachments](#attachments). So, you should avoid passing a `message` variable in your view payload.
> {note} A `$message` variable is always passed to e-mail views, and allows the [inline embedding of attachments](#attachments). So, you should avoid passing a `message` variable in your view payload.
#### Building The Message

Expand Down Expand Up @@ -129,7 +129,7 @@ Here is a list of the available methods on the `$message` message builder instan
// Get the underlying SwiftMailer message instance...
$message->getSwiftMessage();

> **Note:** The message instance passed to a `Mail::send` Closure extends the SwiftMailer message class, allowing you to call any method on that class to build your e-mail messages.
> {note} The message instance passed to a `Mail::send` Closure extends the SwiftMailer message class, allowing you to call any method on that class to build your e-mail messages.
#### Mailing Plain Text

Expand Down
Loading

0 comments on commit 31e5718

Please sign in to comment.