Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
basemkhirat committed Jul 23, 2017
1 parent 0dd47a2 commit a2e8aa4
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,6 @@ $post->title = 'New Post Title';
$post->save();
```

##### Mass Updates

Updates can also be performed against any number of models that match a given query. In this example, all posts that are active and have a views lower than 5 will be marked as archived:

```php
App\post::where('active', 1)
->where('views', "<", 5)
->update(['archived' => 1]);
```

##### Deleting Models

To delete a model, call the `delete()` method on a model instance:
Expand All @@ -488,14 +478,6 @@ $post = App\Post::find(1);
$post->delete();
```

##### Deleting Models By Query

Of course, you may also run a delete statement on a set of models. In this example, we will delete all posts that are marked as inactive. Like mass updates:

```php
$deletedDocuments = App\Post::where('active', 0)->delete();
```

##### Query Scopes

Scopes allow you to define common sets of constraints that you may easily re-use throughout your application. For example, you may need to frequently retrieve all posts that are considered "popular". To define a scope, simply prefix an Eloquent model method with scope.
Expand Down

0 comments on commit a2e8aa4

Please sign in to comment.