-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3dcedf6
commit 007ae6b
Showing
7 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# contains | ||
|
||
The `contains` function checks if a provided string contains a specified substring. To use it, you pass two | ||
parameters: `$haystack` (the full string) and `$needle` (the substring you're looking for). The method then returns a | ||
Boolean, letting you know if the string contains the specified substring. | ||
|
||
## Example Usage | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$people = People::select( | ||
'id', | ||
'first_name', | ||
'last_name', | ||
QE::startsWith(c('first_name'), 'A')->as('is_first_name_starting_with_a') | ||
)->get(); | ||
``` | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$people = People::whereRaw( | ||
QE::startsWith(c('first_name'), 'Walt') | ||
)->get(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# endsWith | ||
|
||
The `endsWith` function checks if a provided string ends with a specified substring. To use it, you pass two | ||
parameters: `$haystack` (the full string) and `$needle` (the substring you're looking for). The method then returns a | ||
Boolean, letting you know if the string ends with the specified substring. | ||
|
||
## Example Usage | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$people = People::select( | ||
'id', | ||
'first_name', | ||
'last_name', | ||
QE::endsWith(c('first_name'), 'Junior')->as('is_first_name_ending_with_junior')) | ||
)->get(); | ||
``` | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$people = People::whereRaw( | ||
QE::endsWith(c('first_name'), 'Junior') | ||
)->get(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# md5 | ||
|
||
The `md5` method, belonging to the Advanced namespace, is a static function to calculate the MD5 hash for a given | ||
parameter. | ||
|
||
## Example Usage | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$books = Book::select( | ||
'id', | ||
'name', | ||
'price', | ||
QE::md5(QE::concatWS(',', c('name', 'price')))->as('checksum') | ||
)->get(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# startsWith | ||
|
||
The `startsWith` function checks if a provided string starts with a specified substring. To use it, you pass two | ||
parameters: `$haystack` (the full string) and `$needle` (the substring you're looking for). The method then returns a | ||
Boolean, letting you know if the string starts with the specified substring. | ||
|
||
## Example Usage | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$people = People::select( | ||
'id', | ||
'first_name', | ||
'last_name', | ||
QE::startsWith(c('first_name'), 'A')->as('is_first_name_starting_with_a') | ||
)->get(); | ||
``` | ||
|
||
```php | ||
use sbamtr\LaravelQueryEnrich\QE; | ||
use function sbamtr\LaravelQueryEnrich\c; | ||
|
||
$people = People::whereRaw( | ||
QE::startsWith(c('first_name'), 'Walt') | ||
)->get(); | ||
``` |