Merge branch 'master' into staging
This commit is contained in:
commit
07bec5c043
|
@ -4,7 +4,3 @@ php:
|
|||
- 5.3
|
||||
|
||||
script: "php artisan test:core"
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
- "irc.freenode.org#laravel"
|
|
@ -299,7 +299,7 @@ ## Inserting Related Models
|
|||
|
||||
$post = Post::find(1);
|
||||
|
||||
$post->comments()->insert($comment);
|
||||
$comment = $post->comments()->insert($comment);
|
||||
|
||||
When inserting related models through their parent model, the foreign key will automatically be set. So, in this case, the "post_id" was automatically set to "1" on the newly inserted comment.
|
||||
|
||||
|
@ -323,7 +323,7 @@ ### Inserting Related Models (Many-To-Many)
|
|||
|
||||
$user = User::find(1);
|
||||
|
||||
$user->roles()->insert($role);
|
||||
$role = $user->roles()->insert($role);
|
||||
|
||||
Now, when the Role is inserted, not only is the Role inserted into the "roles" table, but a record in the intermediate table is also inserted for you. It couldn't be easier!
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ ## Nested Where Clauses
|
|||
->or_where(function($query)
|
||||
{
|
||||
$query->where('age', '>', 25);
|
||||
$query->where('votes' '>', 100);
|
||||
$query->where('votes', '>', 100);
|
||||
})
|
||||
->get();
|
||||
|
||||
|
|
|
@ -78,6 +78,13 @@ #### Allowing a URI segment to be any alpha-numeric string:
|
|||
//
|
||||
});
|
||||
|
||||
#### Catching the remaining URI without limitations:
|
||||
|
||||
Route::get('files/(:all)', function($path)
|
||||
{
|
||||
//
|
||||
});
|
||||
|
||||
#### Allowing a URI segment to be optional:
|
||||
|
||||
Route::get('page/(:any?)', function($page = 'index')
|
||||
|
|
Loading…
Reference in New Issue