Skip to content

Commit

Permalink
added missing return value of update method (laravel#7552)
Browse files Browse the repository at this point in the history
  • Loading branch information
thatal authored Jan 5, 2022
1 parent bec142f commit e9985c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eloquent.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ Updates can also be performed against models that match a given query. In this e
->where('destination', 'San Diego')
->update(['delayed' => 1]);

The `update` method expects an array of column and value pairs representing the columns that should be updated.
The `update` method expects an array of column and value pairs representing the columns that should be updated. The `update` method returns the number of affected rows.

> {note} When issuing a mass update via Eloquent, the `saving`, `saved`, `updating`, and `updated` model events will not be fired for the updated models. This is because the models are never actually retrieved when issuing a mass update.
Expand Down
2 changes: 1 addition & 1 deletion queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ In the example above, Laravel will attempt to insert two records. If a record al
<a name="update-statements"></a>
## Update Statements

In addition to inserting records into the database, the query builder can also update existing records using the `update` method. The `update` method, like the `insert` method, accepts an array of column and value pairs indicating the columns to be updated. You may constrain the `update` query using `where` clauses:
In addition to inserting records into the database, the query builder can also update existing records using the `update` method. The `update` method, like the `insert` method, accepts an array of column and value pairs indicating the columns to be updated. The `update` method returns the number of affected rows. You may constrain the `update` query using `where` clauses:

$affected = DB::table('users')
->where('id', 1)
Expand Down

0 comments on commit e9985c7

Please sign in to comment.