PHPackages                             divineomega/laravel-natural-where - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. divineomega/laravel-natural-where

Abandoned → [jord-jd/laravel-natural-where](/?search=jord-jd%2Flaravel-natural-where)Library[Database &amp; ORM](/categories/database)

divineomega/laravel-natural-where
=================================

Laravel Natural Where extends the Laravel query builder to allow expressing of where operators in natural language.

v3.0.0(2mo ago)91.6k3[1 PRs](https://github.com/Jord-JD/laravel-natural-where/pulls)LGPL-3.0-onlyPHPPHP &gt;=7.1CI failing

Since Nov 22Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/laravel-natural-where)[ Packagist](https://packagist.org/packages/divineomega/laravel-natural-where)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-laravel-natural-where/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Laravel Natural Where
=====================

[](#laravel-natural-where)

Laravel Natural Where extends the Laravel query builder to allow expressing of where operators in natural language.

Installation
------------

[](#installation)

To install Laravel Natural Where, run the following command from the root of your project.

```
composer require jord-jd/laravel-natural-where
```

Usage
-----

[](#usage)

See the basic usage example below.

```
$query = \App\User::query()
    ->naturalWhere('created_at', 'is between the years', ['2018', '2020'])
    ->naturalWhere('email', 'contains the word', 'jordan')
    ->naturalWhere('name', 'is not', 'Jordan Smith')
    ->naturalWhere('id', 'is one of the following', [1, 2, 3])
    ->get();
```

This example will produce the following SQL query.

```
select * from `users` where (`created_at` >= '2018' and `created_at`
