Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miftah704/laravel-query-template-snippets
Extension for visual studio code
https://github.com/miftah704/laravel-query-template-snippets
Last synced: 18 days ago
JSON representation
Extension for visual studio code
- Host: GitHub
- URL: https://github.com/miftah704/laravel-query-template-snippets
- Owner: miftah704
- License: other
- Created: 2022-10-24T12:55:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-26T13:21:24.000Z (about 2 years ago)
- Last Synced: 2023-08-06T08:49:45.792Z (over 1 year ago)
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Query Template Snippets
improve your project.
* Laravel 9x.
* Laravel 8x.## Example
-select()
```
->select('column1','column1')
```
-whereX()
```
->whereColumn('value...')
```-with():multiple
```
->with(['table1:id','table2:id'])
```-firstWhere()
```
->firstWhere('column', 'operator', 'value');
```## Features
#
>**Collection Template Snippets**| Collection |Collection |Collection |
| ---------------------------- |---------------------------- |-------------------------- |
| `-all()` |`-keys()` |`-sortBy()` |
| `-avg()` |`-last()` |`-sortDesc()` |
| `-chunk()` |`-lazy()` |`-sortKeys()` |
| `-collapse()` |`-map()` |`-splitIn()` |
| `-collect()` |`-max()` |`-sum()` |
| `-combine()` |`-merge()` |`-take()` |
| `-concat()` |`-min()` |`-takeUntil()` |
| `-contains()` |`-only()` |`-takeWhile()` |
| `-count()` |`-pluck()` |`-tap()` |
| `-countBy()` |`-pop()` |`-times()` |
| `-crossJoin()` |`-prepend()` |`-toArray()` |
| `-diff()` |`-pull()` |`-toJson()` |
| `-diffAssoc()` |`-push()` |`-union()` |
| `-diffKeys()` |`-put()` |`-unique()` |
| `-doesntContain()` |`-replace()` |`-unwrap()` |
| `-duplicates()` |`-replaceRecursive()` |`-value()` |
| `-every()` |`-reverse()` |`-values()` |
| `-except()` |`-search()` |`-when()` |
| `-filter()` |`-shift()` |`-whenEmpty()` |
| `-first()` |`-shuffle()` |`-whenNotEmpty()` |
| `-firstOrFail()` |`-skip()` |`-where()` |
| `-firstWhere()` |`-skipUntil()` |`-where():operator |
| `-flatMap()` |`-skipWhile()` |`-whereX()` |
| `-flatten()` |`-slice()` |`-whereIn()` |
| `-flip()` |`-sliding()` |`-whereBetween()` |
| `-forget()` |`-sole()` |`-whereNotBetween()` |
| `-forPage()` |`-sort()` |`-whereNotIn()` |
| `-get()` |`-sortKeysUsing()` |`-whereNotNull()` |
| `-groupBy()` |`-splice()` |`-whereNull()` |
| |`-wrap()` |`-orWhere()` |
| |`-zip()` |`-orWhere():operator` |#
>**Query Template Snippets**- xauth:user
```
auth()->user()->id
```-xcreate:template
```
model::create([
'' => value,
]);
```xvalidation:template
```
$validated = $request->validate([
'' => 'data',
]);
```- xview:return
```
return view('pages....', [
'' => ,
]);
```-xcreateMany:template
```
$table->relation()->createMany([
'' => value,
'' => value
]);
```- xredirect:route
```
return redirect()->back()->with('messages',__('flash.insert'));
```- xif:ternary
```
($condition) ? $statment1 : $statment2
```- xgets:var
```
$variable = 'query or data';
```- xarray:3
```
'' => ,
'' => ,
'' => ,
```| query template | query template | query template |
| ------------------------------| ------------------------------| ------------------------------|
| `xauth:user` | `xarray:1` | `xinsertGetId:template` |
| `xredirect:route` | `xarray:2` | `xcreate:template` |
| `xredirect:back` | `xarray:3` | `xupdate:template` |
| `xview:return` | `xgets:var` | `xvalidation:template` |
| `xfunc:arrow` | `xpublic:var` | `xcreateMany:template` |
| `xarrtobj:template` | `xif:ternary` | `xsave:template` |
| | `xcreateInRelation:template` | `xsaveMany:template` |#
>**Blade Template Snippets**- xroute:multiple
```
{{ route('route.name',[$variable1, $variable2, $variable3]) }}
```- xlang:local
```
{{ __('') }}
```- xslot:anonymous
```
{{$variable}}
```- xslot:attribute
```
heading
```- xlink:css
```
```- xlink:js
```
```| blade template | blade template | blade template |
| ---------------------------- | ---------------------------- | ---------------------------- |
| `xroute:single` | `xslot:attribute` | `xmodal:template` |
| `xroute:multiple` | `xlink:css` | `xcol:template` |
| `xroute:non-attribute` | `xlink:js` | `xrow:template` |
| `xlang:local` | `xbutton-toggle` | `xcard:template` |
| `xslot:anonymous` | `xvariant:class` | `xcontent:template` |## Authors
miftah shidiq
<!-- ## Acknowledgments -->