Skip to content

Commit

Permalink
Replace all bolds with h4 headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 3, 2014
1 parent 0bead22 commit f53f291
Show file tree
Hide file tree
Showing 30 changed files with 380 additions and 380 deletions.
8 changes: 4 additions & 4 deletions artisan.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ Artisan is the name of the command-line interface included with Laravel. It prov

To view a list of all available Artisan commands, you may use the `list` command:

**Listing All Available Commands**
#### Listing All Available Commands

php artisan list

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`:

**Viewing The Help Screen For A Command**
#### Viewing The Help Screen For A Command

php artisan help migrate

You may specify the configuration environment that should be used while running a command using the `--env` switch:

**Specifying The Configuration Environment**
#### Specifying The Configuration Environment

php artisan migrate --env=local

You may also view the current version of your Laravel installation using the `--version` option:

**Displaying Your Current Laravel Version**
#### Displaying Your Current Laravel Version

php artisan --version
24 changes: 12 additions & 12 deletions cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,40 @@ The cache configuration file also contains various other options, which are docu
<a name="cache-usage"></a>
## Cache Usage

**Storing An Item In The Cache**
#### Storing An Item In The Cache

Cache::put('key', 'value', $minutes);

**Using Carbon Objects To Set Expire Time**
#### Using Carbon Objects To Set Expire Time

$expiresAt = Carbon::now()->addMinutes(10);

Cache::put('key', 'value', $expiresAt);

**Storing An Item In The Cache If It Doesn't Exist**
#### Storing An Item In The Cache If It Doesn't Exist

Cache::add('key', 'value', $minutes);

The `add` method will return `true` if the item is actually **added** to the cache. Otherwise, the method will return `false`.

**Checking For Existence In Cache**
#### Checking For Existence In Cache

if (Cache::has('key'))
{
//
}

**Retrieving An Item From The Cache**
#### Retrieving An Item From The Cache

$value = Cache::get('key');

**Retrieving An Item Or Returning A Default Value**
#### Retrieving An Item Or Returning A Default Value

$value = Cache::get('key', 'default');

$value = Cache::get('key', function() { return 'default'; });

**Storing An Item In The Cache Permanently**
#### Storing An Item In The Cache Permanently

Cache::forever('key', 'value');

Expand All @@ -69,7 +69,7 @@ You may also combine the `remember` and `forever` methods:

Note that all items stored in the cache are serialized, so you are free to store any type of data.

**Removing An Item From The Cache**
#### Removing An Item From The Cache

Cache::forget('key');

Expand All @@ -78,13 +78,13 @@ Note that all items stored in the cache are serialized, so you are free to store

All drivers except `file` and `database` support the `increment` and `decrement` operations:

**Incrementing A Value**
#### Incrementing A Value

Cache::increment('key');

Cache::increment('key', $amount);

**Decrementing A Value**
#### Decrementing A Value

Cache::decrement('key');

Expand All @@ -97,7 +97,7 @@ All drivers except `file` and `database` support the `increment` and `decrement`
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:

**Accessing A Tagged Cache**
#### Accessing A Tagged Cache

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.

Expand All @@ -107,7 +107,7 @@ You may store a tagged cache by passing in an ordered list of tag names as argum

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`:

**Accessing Items In A Tagged Cache**
#### Accessing Items In A Tagged Cache

To access a tagged cache, pass the same ordered list of tags used to save it.

Expand Down
26 changes: 13 additions & 13 deletions commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In addition to the commands provided with Artisan, you may also build your own c

To create a new command, you may use the `command:make` Artisan command, which will generate a command stub to help you get started:

**Generate A New Command Class**
#### Generate A New Command Class

php artisan command:make FooCommand

Expand Down Expand Up @@ -67,47 +67,47 @@ The `VALUE_NONE` option indicates that the option is simply used as a "switch":

While your command is executing, you will obviously need to access the values for the arguments and options accepted by your application. To do so, you may use the `argument` and `option` methods:

**Retrieving The Value Of A Command Argument**
#### Retrieving The Value Of A Command Argument

$value = $this->argument('name');

**Retrieving All Arguments**
#### Retrieving All Arguments

$arguments = $this->argument();

**Retrieving The Value Of A Command Option**
#### Retrieving The Value Of A Command Option

$value = $this->option('name');

**Retrieving All Options**
#### Retrieving All Options

$options = $this->option();

### Writing Output

To send output to the console, you may use the `info`, `comment`, `question` and `error` methods. Each of these methods will use the appropriate ANSI colors for their purpose.

**Sending Information To The Console**
#### Sending Information To The Console

$this->info('Display this on the screen');

**Sending An Error Message To The Console**
#### Sending An Error Message To The Console

$this->error('Something went wrong!');

### Asking Questions

You may also use the `ask` and `confirm` methods to prompt the user for input:

**Asking The User For Input**
#### Asking The User For Input

$name = $this->ask('What is your name?');

**Asking The User For Secret Input**
#### Asking The User For Secret Input

$password = $this->secret('What is the password?');

**Asking The User For Confirmation**
#### Asking The User For Confirmation

if ($this->confirm('Do you wish to continue? [yes|no]'))
{
Expand All @@ -123,13 +123,13 @@ You may also specify a default value to the `confirm` method, which should be `t

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:

**Registering An Artisan Command**
#### Registering An Artisan Command

Artisan::add(new CustomCommand);

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:

**Registering A Command That Is In The IoC Container**
#### Registering A Command That Is In The IoC Container

Artisan::resolve('binding.name');

Expand All @@ -138,6 +138,6 @@ If your command is registered in the application [IoC container](/docs/ioc), you

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

**Calling Another Command**
#### Calling Another Command

$this->call('command:name', array('argument' => 'foo', '--option' => 'bar'));
6 changes: 3 additions & 3 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ All of the configuration files for the Laravel framework are stored in the `app/

Sometimes you may need to access configuration values at run-time. You may do so using the `Config` class:

**Accessing A Configuration Value**
#### Accessing A Configuration Value

Config::get('app.timezone');

Expand All @@ -21,7 +21,7 @@ You may also specify a default value to return if the configuration option does

Notice that "dot" style syntax may be used to access values in the various files. You may also set configuration values at run-time:

**Setting A Configuration Value**
#### Setting A Configuration Value

Config::set('database.default', 'sqlite');

Expand Down Expand Up @@ -67,7 +67,7 @@ If you need more flexible environment detection, you may pass a `Closure` to the

You may access the current application environment via the `environment` method:

**Accessing The Current Application Environment**
#### Accessing The Current Application Environment

$environment = App::environment();

Expand Down
6 changes: 3 additions & 3 deletions controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ If you would like to use another method on the controller as a filter, you may u

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:

**Defining A RESTful Controller**
#### Defining A RESTful Controller

Route::controller('users', 'UserController');

Expand Down Expand Up @@ -166,7 +166,7 @@ Now we can register a resourceful route to the controller:

This single route declaration creates multiple routes to handle a variety of RESTful actions on the photo resource. Likewise, the generated controller will already have stubbed methods for each of these actions with notes informing you which URIs and verbs they handle.

**Actions Handled By Resource Controller**
#### Actions Handled By Resource Controller

Verb | Path | Action | Route Name
----------|-----------------------------|--------------|---------------------
Expand Down Expand Up @@ -202,7 +202,7 @@ By default, all resource controller actions have a route name; however, you can

A catch-all method may be defined which will be called when no other matching method is found on a given controller. The method should be named `missingMethod`, and receives the method and parameter array for the request:

**Defining A Catch-All Method**
#### Defining A Catch-All Method

public function missingMethod($parameters = array())
{
Expand Down
12 changes: 6 additions & 6 deletions database.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ Note that two keys have been added to the configuration array: `read` and `write

Once you have configured your database connection, you may run queries using the `DB` class.

**Running A Select Query**
#### Running A Select Query

$results = DB::select('select * from users where id = ?', array(1));

The `select` method will always return an `array` of results.

**Running An Insert Statement**
#### Running An Insert Statement

DB::insert('insert into users (id, name) values (?, ?)', array(1, 'Dayle'));

**Running An Update Statement**
#### Running An Update Statement

DB::update('update users set votes = 100 where name = ?', array('John'));

**Running A Delete Statement**
#### Running A Delete Statement

DB::delete('delete from users');

> **Note:** The `update` and `delete` statements return the number of rows affected by the operation.
**Running A General Statement**
#### Running A General Statement

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

You may listen for query events using the `DB::listen` method:

**Listening For Query Events**
#### Listening For Query Events

DB::listen(function($sql, $bindings, $time)
{
Expand Down
Loading

0 comments on commit f53f291

Please sign in to comment.