Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
parsgit committed May 13, 2023
1 parent 2097fda commit 97dc11a
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -729,29 +729,40 @@ DB::table('users')->decrement('votes', 5);

<br>

## Special features:

You can use the more enjoyable Syntax, which in addition to shortening the code, also helps to make the code more readable

### Methods: is / true / false

To create queries based on boolean, you can use 'true' and 'false' or 'is' methods

```PHP
// True

$active_list = DB::table('users')->where('active',true)->get();
//OR
$active_list = DB::table('users')->true('active')->get();
//OR
$active_list = DB::table('users')->is('active')->get();
// OR
$active_list = DB::table('users')->true('active')->get();
```

```PHP

// False

$inactive_list = DB::table('users')->where('active',false)->get();
//OR
$inactive_list = DB::table('users')->is('active', false)->get();
//OR
$inactive_list = DB::table('users')->false('active')->get();
```

### Methods: and / or / in


You don't need to use the where method for your queries consecutively. You can use the and method or use or instead of orWhere.

Example:

```PHP
DB::table('users')
->is('active')
->and('credit', '>', 0)
->or('vip', true)

```


0 comments on commit 97dc11a

Please sign in to comment.