laravel/framework — pull request #1666 by driesvints (2013-06-16 18:43:21+00:00)
Title: Add ignore method to query builder

I added an `ignore` function to the query builder. This function allows you to pass in an array of values (or a closure) to ignore records when performing a query. Basically this is just a layer on top of the `whereNotIn` function but a bit more readable and usable because you'll mostly want to use this for ignoring record id's (default column).

I also added a type casting to array for none closure values so single values can be used.

### Use Cases

Select records from a table but ignore some record IDs.

```php
$users = DB::table('users')->ignore(array(1, 5, 7))->get();
```

Use it to perform an update but ignore the update for some record IDs. In this case, reset all posts to the default category except for posts in the category 'important'.

```php
Post::ignore('important', 'category')->update(array('category' => 'default'));
```

Delete all pages except for the default page.

```php
Page::ignore('default', 'type')->delete();
```