Skip to content

Commit fb85738

Browse files
committed
Fix a ton of doc formatting issues.
1 parent e5e765e commit fb85738

22 files changed

+145
-165
lines changed

artisan.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ Artisan is the name of the command-line interface included with Laravel. It prov
1111
<a name="usage"></a>
1212
## Usage
1313

14-
To view a list of all available Artisan commands, you may use the `list` command:
15-
1614
#### Listing All Available Commands
1715

18-
php artisan list
16+
To view a list of all available Artisan commands, you may use the `list` command:
1917

20-
Every command also includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, simply precede the name of the command with `help`:
18+
php artisan list
2119

2220
#### Viewing The Help Screen For A Command
2321

24-
php artisan help migrate
22+
Every command also includes a "help" screen which displays and describes the command's available arguments and options. To view a help screen, simply precede the name of the command with `help`:
2523

26-
You may specify the configuration environment that should be used while running a command using the `--env` switch:
24+
php artisan help migrate
2725

2826
#### Specifying The Configuration Environment
2927

30-
php artisan migrate --env=local
28+
You may specify the configuration environment that should be used while running a command using the `--env` switch:
3129

32-
You may also view the current version of your Laravel installation using the `--version` option:
30+
php artisan migrate --env=local
3331

3432
#### Displaying Your Current Laravel Version
3533

34+
You may also view the current version of your Laravel installation using the `--version` option:
35+
3636
php artisan --version

cache.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ All drivers except `file` and `database` support the `increment` and `decrement`
9595

9696
> **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.
9797
98-
Cache tags allow you to tag related items in the cache, and then flush all caches tagged with a given name. To access a tagged cache, use the `tags` method:
99-
10098
#### Accessing A Tagged Cache
10199

102-
You may store a tagged cache by passing in an ordered list of tag names as arguments, or as an ordered array of tag names.
100+
Cache tags allow you to tag related items in the cache, and then flush all caches tagged with a given name. To access a tagged cache, use the `tags` method.
101+
102+
You may store a tagged cache by passing in an ordered list of tag names as arguments, or as an ordered array of tag names:
103103

104104
Cache::tags('people', 'authors')->put('John', $john, $minutes);
105105

106106
Cache::tags(array('people', 'artists'))->put('Anne', $anne, $minutes);
107107

108-
You may use any cache storage method in combination with tags, including `remember`, `forever`, and `rememberForever`. You may also access cached items from the tagged cache, as well as use the other cache methods such as `increment` and `decrement`:
108+
You may use any cache storage method in combination with tags, including `remember`, `forever`, and `rememberForever`. You may also access cached items from the tagged cache, as well as use the other cache methods such as `increment` and `decrement`.
109109

110110
#### Accessing Items In A Tagged Cache
111111

commands.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -117,23 +117,21 @@ You may also specify a default value to the `confirm` method, which should be `t
117117
<a name="registering-commands"></a>
118118
## Registering Commands
119119

120-
Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/start/artisan.php` file. Within this file, you may use the `Artisan::add` method to register the command:
121-
122120
#### Registering An Artisan Command
123121

124-
Artisan::add(new CustomCommand);
122+
Once your command is finished, you need to register it with Artisan so it will be available for use. This is typically done in the `app/start/artisan.php` file. Within this file, you may use the `Artisan::add` method to register the command:
125123

126-
If your command is registered in the application [IoC container](/docs/ioc), you may use the `Artisan::resolve` method to make it available to Artisan:
124+
Artisan::add(new CustomCommand);
127125

128126
#### Registering A Command That Is In The IoC Container
129127

128+
If your command is registered in the application [IoC container](/docs/ioc), you may use the `Artisan::resolve` method to make it available to Artisan:
129+
130130
Artisan::resolve('binding.name');
131131

132132
<a name="calling-other-commands"></a>
133133
## Calling Other Commands
134134

135135
Sometimes you may wish to call other commands from your command. You may do so using the `call` method:
136136

137-
#### Calling Another Command
138-
139137
$this->call('command:name', array('argument' => 'foo', '--option' => 'bar'));

configuration.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ You may also specify a default value to return if the configuration option does
2121

2222
$timezone = Config::get('app.timezone', 'UTC');
2323

24-
Notice that "dot" style syntax may be used to access values in the various files. You may also set configuration values at run-time:
25-
2624
#### Setting A Configuration Value
2725

26+
Notice that "dot" style syntax may be used to access values in the various files. You may also set configuration values at run-time:
27+
2828
Config::set('database.default', 'sqlite');
2929

3030
Configuration values that are set at run-time are only set for the current request, and will not be carried over to subsequent requests.
@@ -67,10 +67,10 @@ If you need more flexible environment detection, you may pass a `Closure` to the
6767
return $_SERVER['MY_LARAVEL_ENV'];
6868
});
6969

70-
You may access the current application environment via the `environment` method:
71-
7270
#### Accessing The Current Application Environment
7371

72+
You may access the current application environment via the `environment` method:
73+
7474
$environment = App::environment();
7575

7676
You may also pass arguments to the `environment` method to check if the environment matches a given value:

controllers.md

-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ If you would like to use another method on the controller as a filter, you may u
125125

126126
Laravel allows you to easily define a single route to handle every action in a controller using simple, REST naming conventions. First, define the route using the `Route::controller` method:
127127

128-
#### Defining A RESTful Controller
129-
130128
Route::controller('users', 'UserController');
131129

132130
The `controller` method accepts two arguments. The first is the base URI the controller handles, while the second is the class name of the controller. Next, just add methods to your controller, prefixed with the HTTP verb they respond to:

database.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ The `select` method will always return an `array` of results.
6868

6969
DB::statement('drop table users');
7070

71-
You may listen for query events using the `DB::listen` method:
72-
7371
#### Listening For Query Events
7472

73+
You may listen for query events using the `DB::listen` method:
74+
7575
DB::listen(function($sql, $bindings, $time)
7676
{
7777
//

events.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ The Laravel `Event` class provides a simple observer implementation, allowing yo
2424

2525
$event = Event::fire('auth.login', array($user));
2626

27-
You may also specify a priority when subscribing to events. Listeners with higher priority will be run first, while listeners that have the same priority will be run in order of subscription.
28-
2927
#### Subscribing To Events With Priority
3028

29+
You may also specify a priority when subscribing to events. Listeners with higher priority will be run first, while listeners that have the same priority will be run in order of subscription.
30+
3131
Event::listen('auth.login', 'LoginHandler', 10);
3232

3333
Event::listen('auth.login', 'OtherHandler', 5);
3434

35-
Sometimes, you may wish to stop the propagation of an event to other listeners. You may do so using by returning `false` from your listener:
36-
3735
#### Stopping The Propagation Of An Event
3836

37+
Sometimes, you may wish to stop the propagation of an event to other listeners. You may do so using by returning `false` from your listener:
38+
3939
Event::listen('auth.login', function($event)
4040
{
4141
// Handle the event...
@@ -52,10 +52,10 @@ If your `start` files are getting too crowded, you could create a separate `app/
5252
<a name="wildcard-listeners"></a>
5353
## Wildcard Listeners
5454

55-
When registering an event listener, you may use asterisks to specify wildcard listeners:
56-
5755
#### Registering Wildcard Event Listeners
5856

57+
When registering an event listener, you may use asterisks to specify wildcard listeners:
58+
5959
Event::listen('foo.*', function($param)
6060
{
6161
// Handle the event...
@@ -82,10 +82,10 @@ In some cases, you may wish to use a class to handle an event rather than a Clos
8282

8383
Event::listen('auth.login', 'LoginHandler');
8484

85-
By default, the `handle` method on the `LoginHandler` class will be called:
86-
8785
#### Defining An Event Listener Class
8886

87+
By default, the `handle` method on the `LoginHandler` class will be called:
88+
8989
class LoginHandler {
9090

9191
public function handle($data)
@@ -95,19 +95,19 @@ By default, the `handle` method on the `LoginHandler` class will be called:
9595

9696
}
9797

98-
If you do not wish to use the default `handle` method, you may specify the method that should be subscribed:
99-
10098
#### Specifying Which Method To Subscribe
10199

100+
If you do not wish to use the default `handle` method, you may specify the method that should be subscribed:
101+
102102
Event::listen('auth.login', 'LoginHandler@onLogin');
103103

104104
<a name="queued-events"></a>
105105
## Queued Events
106106

107-
Using the `queue` and `flush` methods, you may "queue" an event for firing, but not fire it immediately:
108-
109107
#### Registering A Queued Event
110108

109+
Using the `queue` and `flush` methods, you may "queue" an event for firing, but not fire it immediately:
110+
111111
Event::queue('foo', array($user));
112112

113113
#### Registering An Event Flusher
@@ -124,10 +124,10 @@ Finally, you may run the "flusher" and flush all queued events using the `flush`
124124
<a name="event-subscribers"></a>
125125
## Event Subscribers
126126

127-
Event subscribers are classes that may subscribe to multiple events from within the class itself. Subscribers should define a `subscribe` method, which will be passed an event dispatcher instance:
128-
129127
#### Defining An Event Subscriber
130128

129+
Event subscribers are classes that may subscribe to multiple events from within the class itself. Subscribers should define a `subscribe` method, which will be passed an event dispatcher instance:
130+
131131
class UserEventHandler {
132132

133133
/**
@@ -161,10 +161,10 @@ Event subscribers are classes that may subscribe to multiple events from within
161161

162162
}
163163

164-
Once the subscriber has been defined, it may be registered with the `Event` class.
165-
166164
#### Registering An Event Subscriber
167165

166+
Once the subscriber has been defined, it may be registered with the `Event` class.
167+
168168
$subscriber = new UserEventHandler;
169169

170170
Event::subscribe($subscriber);

html.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ If your form is going to accept file uploads, add a `files` option to your array
4646
<a name="csrf-protection"></a>
4747
## CSRF Protection
4848

49-
Laravel provides an easy method of protecting your application from cross-site request forgeries. First, a random token is placed in your user's session. Don't sweat it, this is done automatically. The CSRF token will be added to your forms as a hidden field automatically. However, if you wish to generate the HTML for the hidden field, you may use the `token` method:
50-
5149
#### Adding The CSRF Token To A Form
5250

51+
Laravel provides an easy method of protecting your application from cross-site request forgeries. First, a random token is placed in your user's session. Don't sweat it, this is done automatically. The CSRF token will be added to your forms as a hidden field automatically. However, if you wish to generate the HTML for the hidden field, you may use the `token` method:
52+
5353
echo Form::token();
5454

5555
#### Attaching The CSRF Filter To A Route
@@ -62,10 +62,10 @@ Laravel provides an easy method of protecting your application from cross-site r
6262
<a name="form-model-binding"></a>
6363
## Form Model Binding
6464

65-
Often, you will want to populate a form based on the contents of a model. To do so, use the `Form::model` method:
66-
6765
#### Opening A Model Form
6866

67+
Often, you will want to populate a form based on the contents of a model. To do so, use the `Form::model` method:
68+
6969
echo Form::model($user, array('route' => array('user.update', $user->id)))
7070

7171
Now, when you generate a form element, like a text input, the model's value matching the field's name will automatically be set as the field value. So, for example, for a text input named `email`, the user model's `email` attribute would be set as the value. However, there's more! If there is an item in the Session flash data matching the input name, that will take precedence over the model's value. So, the priority looks like this:
@@ -175,10 +175,10 @@ This allows you to quickly build forms that not only bind to model values, but e
175175
<a name="custom-macros"></a>
176176
## Custom Macros
177177

178-
It's easy to define your own custom Form class helpers called "macros". Here's how it works. First, simply register the macro with a given name and a Closure:
179-
180178
#### Registering A Form Macro
181179

180+
It's easy to define your own custom Form class helpers called "macros". Here's how it works. First, simply register the macro with a given name and a Closure:
181+
182182
Form::macro('myField', function()
183183
{
184184
return '<input type="awesome">';

ioc.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ Understanding the Laravel IoC container is essential to building a powerful, lar
1818
<a name="basic-usage"></a>
1919
## Basic Usage
2020

21-
There are two ways the IoC container can resolve dependencies: via Closure callbacks or automatic resolution. First, we'll explore Closure callbacks. First, a "type" may be bound into the container:
22-
2321
#### Binding A Type Into The Container
2422

23+
There are two ways the IoC container can resolve dependencies: via Closure callbacks or automatic resolution. First, we'll explore Closure callbacks. First, a "type" may be bound into the container:
24+
2525
App::bind('foo', function($app)
2626
{
2727
return new FooBar;
@@ -33,19 +33,19 @@ There are two ways the IoC container can resolve dependencies: via Closure callb
3333

3434
When the `App::make` method is called, the Closure callback is executed and the result is returned.
3535

36-
Sometimes, you may wish to bind something into the container that should only be resolved once, and the same instance should be returned on subsequent calls into the container:
37-
3836
#### Binding A "Shared" Type Into The Container
3937

38+
Sometimes, you may wish to bind something into the container that should only be resolved once, and the same instance should be returned on subsequent calls into the container:
39+
4040
App::singleton('foo', function()
4141
{
4242
return new FooBar;
4343
});
4444

45-
You may also bind an existing object instance into the container using the `instance` method:
46-
4745
#### Binding An Existing Instance Into The Container
4846

47+
You may also bind an existing object instance into the container using the `instance` method:
48+
4949
$foo = new Foo;
5050

5151
App::instance('foo', $foo);
@@ -60,10 +60,10 @@ If your application has a very large number of IoC bindings, or you simply wish
6060
<a name="automatic-resolution"></a>
6161
## Automatic Resolution
6262

63-
The IoC container is powerful enough to resolve classes without any configuration at all in many scenarios. For example:
64-
6563
#### Resolving A Class
6664

65+
The IoC container is powerful enough to resolve classes without any configuration at all in many scenarios. For example:
66+
6767
class FooBar {
6868

6969
public function __construct(Baz $baz)
@@ -79,10 +79,10 @@ Note that even though we did not register the FooBar class in the container, the
7979

8080
When a type is not bound in the container, it will use PHP's Reflection facilities to inspect the class and read the constructor's type-hints. Using this information, the container can automatically build an instance of the class.
8181

82-
However, in some cases, a class may depend on an interface implementation, not a "concrete type". When this is the case, the `App::bind` method must be used to inform the container which interface implementation to inject:
83-
8482
#### Binding An Interface To An Implementation
8583

84+
However, in some cases, a class may depend on an interface implementation, not a "concrete type". When this is the case, the `App::bind` method must be used to inform the container which interface implementation to inject:
85+
8686
App::bind('UserRepositoryInterface', 'DbUserRepository');
8787

8888
Now consider the following controller:
@@ -123,10 +123,10 @@ Laravel provides several opportunities to use the IoC container to increase the
123123

124124
In this example, the `OrderRepository` class will automatically be injected into the controller. This means that when [unit testing](/docs/testing) a "mock" `OrderRepository` may be bound into the container and injected into the controller, allowing for painless stubbing of database layer interaction.
125125

126-
[Filters](/docs/routing#route-filters), [composers](/docs/responses#view-composers), and [event handlers](/docs/events#using-classes-as-listeners) may also be resolved out of the IoC container. When registering them, simply give the name of the class that should be used:
127-
128126
#### Other Examples Of IoC Usage
129127

128+
[Filters](/docs/routing#route-filters), [composers](/docs/responses#view-composers), and [event handlers](/docs/events#using-classes-as-listeners) may also be resolved out of the IoC container. When registering them, simply give the name of the class that should be used:
129+
130130
Route::filter('foo', 'FooFilter');
131131

132132
View::composer('foo', 'FooComposer');
@@ -140,10 +140,10 @@ Service providers are a great way to group related IoC registrations in a single
140140

141141
In fact, most of the core Laravel components include service providers. All of the registered service providers for your application are listed in the `providers` array of the `app/config/app.php` configuration file.
142142

143-
To create a service provider, simply extend the `Illuminate\Support\ServiceProvider` class and define a `register` method:
144-
145143
#### Defining A Service Provider
146144

145+
To create a service provider, simply extend the `Illuminate\Support\ServiceProvider` class and define a `register` method:
146+
147147
use Illuminate\Support\ServiceProvider;
148148

149149
class FooServiceProvider extends ServiceProvider {
@@ -160,19 +160,19 @@ To create a service provider, simply extend the `Illuminate\Support\ServiceProvi
160160

161161
Note that in the `register` method, the application IoC container is available to you via the `$this->app` property. Once you have created a provider and are ready to register it with your application, simply add it to the `providers` array in your `app` configuration file.
162162

163-
You may also register a service provider at run-time using the `App::register` method:
164-
165163
#### Registering A Service Provider At Run-Time
166164

165+
You may also register a service provider at run-time using the `App::register` method:
166+
167167
App::register('FooServiceProvider');
168168

169169
<a name="container-events"></a>
170170
## Container Events
171171

172-
The container fires an event each time it resolves an object. You may listen to this event using the `resolving` method:
173-
174172
#### Registering A Resolving Listener
175173

174+
The container fires an event each time it resolves an object. You may listen to this event using the `resolving` method:
175+
176176
App::resolvingAny(function($object)
177177
{
178178
//

lifecycle.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ Start files serve as a simple place to place any "bootstrapping" code. For examp
5353
<a name="application-events"></a>
5454
## Application Events
5555

56-
You may also do pre and post request processing by registering `before`, `after`, `finish`, and `shutdown` application events:
57-
5856
#### Registering Application Events
5957

58+
You may also do pre and post request processing by registering `before`, `after`, `finish`, and `shutdown` application events:
59+
6060
App::before(function($request)
6161
{
6262
//

0 commit comments

Comments
 (0)