Skip to content

Commit

Permalink
Merge. Fix conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 8, 2014
2 parents 3211af2 + dc776b9 commit b91f969
Show file tree
Hide file tree
Showing 23 changed files with 147 additions and 45 deletions.
2 changes: 1 addition & 1 deletion configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Be sure to add the `.env.local.php` file to your `.gitignore` file. This will al

Now, on your production server, create a `.env.php` file in your project root that contains the corresponding values for your production environment. Like the `.env.local.php` file, the production `.env.php` file should never be included in source control.

> **Note:** You may create a file for each environment supported by your application. For example, the `development` environment will load the `.env.development.php` file if it exists.
> **Note:** You may create a file for each environment supported by your application. For example, the `development` environment will load the `.env.development.php` file if it exists. However, the `production` environment always uses the `.env.php` file.
<a name="maintenance-mode"></a>
## Maintenance Mode
Expand Down
77 changes: 77 additions & 0 deletions contributions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contribution Guide

- [Introduction](#introduction)
- [Core Development Discussion](#core-development-discussion)
- [New Features](#new-features)
- [Bugs](#bugs)
- [Which Branch?](#which-branch)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Coding Style](#coding-style)

<a name="introduction"></a>
## Introduction

Laravel is an open-source project and anyone may contribute to Laravel for its improvement. We welcome contributors, regardless of skill level, gender, race, religion, or nationality. Having a diverse, vibrant community is one of the core values of the framework!

To encourage active collaboration, Laravel currently only accepts pull requests, not bug reports. "Bug reports" may be sent in the form of a pull request containing a failing unit test. A failing unit test provides the development team "proof" that the bug exists, and, after the development team addresses the bug, serves as a reliable indicator that the bug remains fixed.

The Laravel source code is managed on Github, and there are repositories for each of the Laravel projects:

- [Laravel Framework](https://github.com/laravel/framework)
- [Laravel Application](https://github.com/laravel/laravel)
- [Laravel Documentation](https://github.com/laravel/docs)
- [Laravel Cashier](https://github.com/laravel/cashier)
- [Laravel Envoy](https://github.com/laravel/envoy)
- [Laravel Homestead](https://github.com/laravel/homestead)
- [Laravel Homestead Build Scripts](https://github.com/laravel/settler)
- [Laravel Website](https://github.com/laravel/website)
- [Laravel Art](https://github.com/laravel/art)

<a name="core-development-discussion"></a>
## Core Development Discussion

Discussion regarding bugs, implementation of existing features, and new features takes place in the `#laravel-dev` IRC channel (Freenode). Taylor Otwell, the maintainer of Laravel, is typically present in the channel on weekdays from 8am-5pm (UTC-06:00 or America/Chicago), and sporadically present in the channel at other times.

The `#laravel-dev` IRC channel is open to all. All are welcome to join the channel either to participate or simply observe the discussions!

<a name="new-features"></a>
## New Features

Before sending pull requests for new features, please contact Taylor Otwell via the `#laravel-dev` IRC channel (Freenode). If the feature is found to be a good fit for the framework, you are free to make a pull request. If the feature is rejected, don't give up! You are still free to turn your feature into a package which can be released to the world via [Packagist](https://packagist.org/).

When adding new features, don't forget to add unit tests! Unit tests help ensure the stability and reliability of the framework as new features are added.

<a name="bugs"></a>
## Bugs

Pull requests for bugs may be sent without prior discussion with the Laravel development team. When submitting a bug fix, try to include a unit test that ensures the bug never appears again!

If you believe you have found a bug in the framework, but are unsure how to fix it, please send a pull request containing a failing unit test. A failing unit test provides the development team "proof" that the bug exists, and, after the development team addresses the bug, serves as a reliable indicator that the bug remains fixed.

If are unsure how to write a failing unit test for a bug, review the other unit tests included with the framework. If you're still lost, you may ask for help in the `#laravel` IRC channel (Freenode).

<a name="which-branch"></a>
## Which Branch?

**ALL** bug fixes should be sent to the latest stable branch. Bug fixes should **never** be sent to the `master` branch unless they fix features that exist only in the upcoming release.

**Minor** features that are **fully backwards compatible** with the current Laravel release may be sent to the latest stable branch.

**Major** new features should always be sent to the `master` branch, which contains the upcoming Laravel release.

If you are unsure if your feature qualifies as a major or minor, please ask Taylor Otwell in the `#laravel-dev` IRC channel (Freenode).

<a name="security-vulnerabilities"></a>
## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at <a href="mailto:taylorotwell@gmail.com">taylorotwell@gmail.com</a>. All security vulnerabilities will be promptly addressed.

<a name="coding-style"></a>
## Coding Style

Laravel follows the [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) and [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) coding standards. In addition to these standards, the following coding standards should be followed:

- The class namespace declaration must be on the same line as `<?php`.
- A class' opening `{` must be on the same line as the class name.
- Functions and control structures must use Allman style braces.
- Indent with tabs, align with spaces.
18 changes: 10 additions & 8 deletions controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

- [Basic Controllers](#basic-controllers)
- [Controller Filters](#controller-filters)
- [RESTful Controllers](#restful-controllers)
- [Resource Controllers](#resource-controllers)
- [Implicit Controllers](#implicit-controllers)
- [RESTful Resource Controllers](#resftul-resource-controllers)
- [Handling Missing Methods](#handling-missing-methods)

<a name="basic-controllers"></a>
Expand Down Expand Up @@ -129,10 +129,10 @@ If you would like to use another method on the controller as a filter, you may u

}

<a name="restful-controllers"></a>
## RESTful Controllers
<a name="implicit-controllers"></a>
## Implicit Controllers

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:
Laravel allows you to easily define a single route to handle every action in a controller. First, define the route using the `Route::controller` method:

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

Expand Down Expand Up @@ -163,8 +163,8 @@ If your controller action contains multiple words, you may access the action usi

public function getAdminProfile() {}

<a name="resource-controllers"></a>
## Resource Controllers
<a name="restful-resource-controllers"></a>
## RESTful Resource Controllers

Resource controllers make it easier to build RESTful controllers around resources. For example, you may wish to create a controller that manages "photos" stored by your application. Using the `controller:make` command via the Artisan CLI and the `Route::resource` method, we can quickly create such a controller.

Expand Down Expand Up @@ -230,11 +230,13 @@ If it becomes necessary for you to add additional routes to a resource controlle
<a name="handling-missing-methods"></a>
## Handling Missing Methods

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:
When using `Route::controller`, 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

public function missingMethod($parameters = array())
{
//
}

If you are using resource controllers, you should define a `__call` magic method on the controller to handle any missing methods.
1 change: 1 addition & 0 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [Quickstart](/docs/quick)
- [Release Notes](/docs/releases)
- [Upgrade Guide](/docs/upgrade)
- [Contribution Guide](/docs/contributions)
- Getting Started
- [Installation](/docs/installation)
- [Configuration](/docs/configuration)
Expand Down
10 changes: 9 additions & 1 deletion eloquent.md
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,14 @@ Of course, the opposite of `attach` is `detach`:

$user->roles()->detach(1);

Both `attach` and `detach` also take arrays of IDs as input:

$user = User::find(1);

$user->roles()->detach([1, 2, 3]);

$user->roles()->attach([1 => ['attribute1' => 'value1'], 2, 3]);

#### Using Sync To Attach Many To Many Models

You may also use the `sync` method to attach related models. The `sync` method accepts an array of IDs to place on the pivot table. After this operation is complete, only the IDs in the array will be on the intermediate table for the model:
Expand Down Expand Up @@ -1278,4 +1286,4 @@ Once you have created the accessor, just add the value to the `appends` property

protected $appends = array('is_admin');

Once the attribute has been added to the `appends` list, it will be included in both the model's array and JSON forms.
Once the attribute has been added to the `appends` list, it will be included in both the model's array and JSON forms. Attributes in the `appends` array respect the `visible` and `hidden` configuration on the model.
2 changes: 2 additions & 0 deletions helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ The `array_get` method will retrieve a given value from a deeply nested array us

$value = array_get($array, 'names.joe');

$value = array_get($array, 'names.john', 'default');

> **Note:** Want something like `array_get` but for objects instead? Use `object_get`.
### array_only
Expand Down
2 changes: 2 additions & 0 deletions homestead.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a

Homestead runs on any Windows, Mac, and Linux, and includes the Nginx web server, PHP 5.6, MySQL, Postgres, Redis, Memcached 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.
Homestead is currently built and tested using Vagrant 1.6.

<a name="included-software"></a>
Expand Down
8 changes: 8 additions & 0 deletions html.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Text, Text Area, Password & Hidden Fields](#text)
- [Checkboxes and Radio Buttons](#checkboxes-and-radio-buttons)
- [File Input](#file-input)
- [Number Input](#number)
- [Drop-Down Lists](#drop-down-lists)
- [Buttons](#buttons)
- [Custom Macros](#custom-macros)
Expand Down Expand Up @@ -128,6 +129,13 @@ This allows you to quickly build forms that not only bind to model values, but e

echo Form::radio('name', 'value', true);

<a name="number"></a>
## Number

#### Generating A Number Input

echo Form::number('name', 'value');

<a name="file-input"></a>
## File Input

Expand Down
4 changes: 2 additions & 2 deletions lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a name="overview"></a>
## Overview

When using any tool in the "real world", you feel more confidence if you understand how that tool works. Application development is no different. When you understand how your development tools function, you feel more comfortable and confident using them. The goal of this document is to give you a good, high-level overview of how the Laravel framework "works". By getting to know the overall framework better, everything feels less "magical" and you will be more confident building your applications. In addition to a high-level overview of the request lifecycle, we'll cover service providers and application events.
When using any tool in the "real world", you feel more confident if you understand how that tool works. Application development is no different. When you understand how your development tools function, you feel more comfortable and confident using them. The goal of this document is to give you a good, high-level overview of how the Laravel framework "works". By getting to know the overall framework better, everything feels less "magical" and you will be more confident building your applications. In addition to a high-level overview of the request lifecycle, we'll cover service providers and application events.

If you don't understand all of the terms right away, don't lose heart! Just try to get a basic grasp of what is going on, and your knowledge will grow as you explore other sections of the documentation.

Expand Down Expand Up @@ -83,4 +83,4 @@ You may also register a listener on the `matched` event, which is fired when an
//
});

The `finish` event is called after the response from your application has been sent back to the client. This is a good place to do any last minute processing your application requires. The `shutdown` event is called immediately after all of the `finish` event handlers finish processing, and is the last opportunity to do any work before the script terminates. Most likely, you will not have a need to use either of these events.
The `finish` event is called after the response from your application has been sent back to the client. This is a good place to do any last minute processing your application requires. The `shutdown` event is called immediately after all of the `finish` event handlers finish processing, and is the last opportunity to do any work before the script terminates. Most likely, you will not have a need to use either of these events.
2 changes: 1 addition & 1 deletion localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ You may also configure a "fallback language", which will be used when the active

The first segment of the string passed to the `get` method is the name of the language file, and the second is the name of the line that should be retrieved.

> **Note**: If a language line does not exist, the key will be returned by the `get` method.
> **Note:** If a language line does not exist, the key will be returned by the `get` method.
You may also use the `trans` helper function, which is an alias for the `Lang::get` method.

Expand Down
4 changes: 2 additions & 2 deletions mail.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ If the `driver` option of your `config/mail.php` configuration file is set to `l

The `Mail::send` method may be used to send an e-mail message:

Mail::send('emails.welcome', $data, function($message)
Mail::send('emails.welcome', array('key' => 'value'), function($message)
{
$message->to('foo@example.com', 'John Smith')->subject('Welcome!');
});

The first argument passed to the `send` method is the name of the view that should be used as the e-mail body. The second is the `$data` that should be passed to the view, and the third is a Closure allowing you to specify various options on the e-mail message.
The first argument passed to the `send` method is the name of the view that should be used as the e-mail body. The second is the data to be passed to the view, often as an associative array where the data items are available to the view by `$key`. The third is a Closure allowing you to specify various options on the e-mail message.

> **Note:** A `$message` variable is always passed to e-mail views, and allows the inline embedding of attachments. So, it is best to avoid passing a `message` variable in your view payload.
Expand Down
2 changes: 1 addition & 1 deletion migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a name="introduction"></a>
## Introduction

Migrations are a type of version control for your database. They allow a team to modify the database schema and stay up to date on the current schema state. Migrations are typically paired with the [Schema Builder](/docs/schema) to easily manage your application's scheme.
Migrations are a type of version control for your database. They allow a team to modify the database schema and stay up to date on the current schema state. Migrations are typically paired with the [Schema Builder](/docs/schema) to easily manage your application's schema.

<a name="creating-migrations"></a>
## Creating Migrations
Expand Down
2 changes: 1 addition & 1 deletion pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Extend the `Illuminate\Pagination\Presenter` class and implement its abstract me
return '<li class="unavailable">'.$text.'</li>';
}

public function getPageLinkWrapper($url, $page)
public function getPageLinkWrapper($url, $page, $rel = null)
{
return '<li><a href="'.$url.'">'.$page.'</a></li>';
}
Expand Down
28 changes: 14 additions & 14 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,20 +216,6 @@ Sometimes you may need to use a raw expression in a query. These expressions wil
->groupBy('status')
->get();

#### Incrementing or decrementing a value of a column

DB::table('users')->increment('votes');

DB::table('users')->increment('votes', 5);

DB::table('users')->decrement('votes');

DB::table('users')->decrement('votes', 5);

You may also specify additional columns to update:

DB::table('users')->increment('votes', 1, array('name' => 'John'));

<a name="inserts"></a>
## Inserts

Expand Down Expand Up @@ -265,6 +251,20 @@ If the table has an auto-incrementing id, use `insertGetId` to insert a record a
->where('id', 1)
->update(array('votes' => 1));

#### Incrementing or decrementing a value of a column

DB::table('users')->increment('votes');

DB::table('users')->increment('votes', 5);

DB::table('users')->decrement('votes');

DB::table('users')->decrement('votes', 5);

You may also specify additional columns to update:

DB::table('users')->increment('votes', 1, array('name' => 'John'));

<a name="deletes"></a>
## Deletes

Expand Down
2 changes: 1 addition & 1 deletion queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ As you can see, the `queue:work` command supports most of the same options avail

### Deploying With Daemon Queue Workers

The simplest way to deploy an application using daemon queue workers is to put the application in maintenance mode at the beginning of your deploymnet. This can be done using the `php artisan down` command. Once the application is in maintenance mode, Laravel will not accept any new jobs off of the queue, but will continue to process existing jobs.
The simplest way to deploy an application using daemon queue workers is to put the application in maintenance mode at the beginning of your deployment. This can be done using the `php artisan down` command. Once the application is in maintenance mode, Laravel will not accept any new jobs off of the queue, but will continue to process existing jobs.

The easiest way to restart your workers is to include the following command in your deployment script:

Expand Down
Loading

0 comments on commit b91f969

Please sign in to comment.