├── .gitignore ├── .vscode └── launch.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── images ├── icon.png └── screenshot.gif ├── package.json └── snippets ├── arr.json ├── auth.json ├── broadcast.json ├── cache.json ├── collective_form_html.json ├── config.json ├── console.json ├── cookie.json ├── crypt.json ├── db.json ├── eloquent.json ├── event.json ├── hash.json ├── helper.json ├── log.json ├── mail.json ├── model.json ├── passport.json ├── redirect.json ├── relation.json ├── request.json ├── response.json ├── route.json ├── schema.json ├── session.json ├── storage.json ├── str.json └── view.json /.gitignore: -------------------------------------------------------------------------------- 1 | ### Windows ### 2 | # Windows image file caches 3 | Thumbs.db 4 | ehthumbs.db 5 | 6 | # Folder config file 7 | Desktop.ini 8 | 9 | ### macOS ### 10 | *.DS_Store 11 | .AppleDouble 12 | .LSOverride 13 | 14 | # Thumbnails 15 | ._* -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/**/* 2 | .gitignore 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.19.1 2 | 3 | * Add `Arr::take` 4 | 5 | ## 1.19.0 6 | 7 | * Update `Arr` snippets 8 | 9 | ## 1.18.1 10 | 11 | * Add missing "@" symbol for return type annotation ([@tobinguyenn](https://github.com/tobinguyenn) - PR #42) 12 | 13 | ## 1.18.0 14 | 15 | * Add snippet for laravel model with `Model::` ([@tobinguyenn](https://github.com/tobinguyenn) - PR #41) 16 | 17 | ## 1.17.0 18 | 19 | Support new snippets for Laravel v9.x 20 | 21 | * Add `Str::lcfirst` (v9.4) 22 | * Add `Str::wrap` (v9.5) 23 | * Add `Arr::join` (v9.11) 24 | * Add `Arr::map` (v9.13) 25 | * Fix typo 26 | 27 | ## 1.16.0 28 | 29 | Support new snippets for Laravel v9.2.0 30 | 31 | * Add `Eloquent-attribute-make` 32 | * Add `Arr::keyBy` 33 | * Add `Str::betweenFirst` 34 | 35 | ## 1.15.0 36 | 37 | * Add `Eloquent-getter` and `Eloquent-setter` snippets ([@fabrola22](https://github.com/fabrola22) - [PR #36](https://github.com/onecentlin/laravel5-snippets-vscode/pull/36)) 38 | * Fix snippets 39 | 40 | ## 1.14.0 41 | 42 | [Laravel 9.x](https://laravel.com/docs/9.x/releases) new features 43 | 44 | * Add `Eloquent-attribute` for eloquent accessors / mutators 45 | * Add `Rotue-controller-group` for controller route groups 46 | * Add `Route-get-scopeBindings` and `Route-group-scopeBindings` for forcing scoping of route bindings 47 | 48 | ## 1.13.0 49 | 50 | * Fix `Route::resource` syntax issue ([#33](https://github.com/onecentlin/laravel5-snippets-vscode/issues/33)) 51 | 52 | ## 1.12.0 53 | 54 | * Add `Route-get-name`, `Route-post-name` for naming routes 55 | * Add `Route::current`, `Route::currentRouteName` 56 | * Update `Route-controllerAction` with naming route 57 | * Replace log message with double-quotes ([@MartinP7r](https://github.com/MartinP7r) - [PR #32](https://github.com/onecentlin/laravel5-snippets-vscode/pull/32)) 58 | 59 | ## 1.11.0 60 | 61 | * Add relation return type ([@samir-araujo](https://github.com/samir-araujo) - [PR #27](https://github.com/onecentlin/laravel5-snippets-vscode/pull/27)) 62 | * Route & Relation compatible with Laravel 8 ([@MrEduar](https://github.com/MrEduar) - [PR #30](https://github.com/onecentlin/laravel5-snippets-vscode/pull/30)) 63 | 64 | ## 1.10.0 65 | 66 | * Fix `Column::decimal` ([@dittoex](https://github.com/dittoex) - [PR #24](https://github.com/onecentlin/laravel5-snippets-vscode/pull/24)) 67 | * Update helper snippets 68 | * Add `Helper::dd` 69 | 70 | ## 1.9.0 71 | 72 | * Sync `Str` api to Laravel v7.x 73 | * Add `Str::after`, `Str::afterLast`, `Str::ascii` ([@gentritabazi01](https://github.com/gentritabazi01) - [PR #22](https://github.com/onecentlin/laravel5-snippets-vscode/pull/22)) 74 | 75 | ## 1.8.0 76 | 77 | * Add `Str::plural` and `Str::limit` ([@wdog](https://github.com/wdog) - [PR #19](https://github.com/onecentlin/laravel5-snippets-vscode/pull/19)) 78 | * Fix syntax error View ::makeCompact ([#17](https://github.com/onecentlin/laravel5-snippets-vscode/issues/17)) 79 | * Add `Route::dispatch` and `Route::dispatchToRoute` ([#12](https://github.com/onecentlin/laravel5-snippets-vscode/issues/12)) 80 | * Rename VS Code extension name to `Laravel Snippets` in order to support for Laravel 5 and above version. 81 | 82 | ## 1.7.0 83 | 84 | * Update Cache parameters using ttl instead of minutes ([@nicoeg](https://github.com/nicoeg)) - [PR #16](https://github.com/onecentlin/laravel5-snippets-vscode/pull/16) 85 | 86 | ## 1.6.0 87 | 88 | * Added snippets for laravel collective form and html ([@mnshankar](https://github.com/mnshankar) - [PR #10](https://github.com/onecentlin/laravel5-snippets-vscode/pull/10)) 89 | * Changed increments to bigIncrements ([@sidvanvliet](https://github.com/sidvanvliet) - [PR #15](https://github.com/onecentlin/laravel5-snippets-vscode/pull/15)) 90 | 91 | ## 1.5.0 92 | 93 | Support new snippets for Laravel 5.6 94 | 95 | * Add `Str::uuid` and `Str::orderedUuid` 96 | * Add `Broadcast::channel` 97 | 98 | Support new snippets for Laravel 5.5 99 | 100 | * Add `Route::redirect` 101 | * Add `Route::view` 102 | * Add `Cache::lock` with `get`, `release`, `block` 103 | 104 | ## 1.4.0 105 | 106 | * Add `Helper::dd` for `dd()` die and dump helper ([#8](https://github.com/onecentlin/laravel5-snippets-vscode/issues/8)) 107 | * Fix response format ([#5](https://github.com/onecentlin/laravel5-snippets-vscode/issues/5)) 108 | 109 | ## 1.3.4 110 | 111 | * Fix syntax for PSR2 ([@tradzero](https://github.com/tradzero) - [PR #4](https://github.com/onecentlin/laravel5-snippets-vscode/pull/4)) 112 | * Fix `Route` syntax issues. 113 | 114 | ## 1.3.3 115 | 116 | * Added `Blueprint` type check to table update snippet. ([@thelfensdrfer](https://github.com/thelfensdrfer) - [PR #3](https://github.com/onecentlin/laravel5-snippets-vscode/pull/3)) 117 | 118 | ## 1.3.2 119 | 120 | * Add `$table->timestamps();` as defualt fields while creating table schema. ([#2](https://github.com/onecentlin/laravel5-snippets-vscode/issues/2)) 121 | * Fix snippets stop position. 122 | 123 | ## 1.3.1 124 | 125 | * Add missing support in DB: `DB::table` ([#1](https://github.com/onecentlin/laravel5-snippets-vscode/issues/1)) 126 | 127 | ## 1.3.0 128 | 129 | * Support new snippets for Laravel 5.3 API Authentication ([Passport](https://laravel.com/docs/5.3/passport)) 130 | * Add missing support in Authentication: `Auth::guard`, `Auth::attempt`, `Auth::login`, `Auth::loginUsingId`, `Auth::viaRemember`, `Auth::routes` 131 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Winnie Lin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Laravel Snippets 2 | 3 | [`Laravel snippets`](https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel5-snippets) extension for Visual Studio Code (Support Laravel 5 and above version). 4 | 5 | - Laravel 5.x-12.x 6 | 7 | ## Screenshot 8 | 9 | ![Screenshot](https://github.com/onecentlin/laravel5-snippets-vscode/raw/master/images/screenshot.gif) 10 | 11 | ## Usage 12 | 13 | Snippet prefix follows Laravel Facades. For example: `Request::`, `Route::` 14 | 15 | ## Support Snippet Prefix 16 | 17 | * Arr 18 | * Auth 19 | * Broadcast 20 | * Cache 21 | * Config 22 | * Console 23 | * Cookie 24 | * Crypt 25 | * DB 26 | * Eloquent 27 | * Event 28 | * Form ([Laravel Collective Form/Html](https://packagist.org/packages/laravelcollective/html) needs to be installed and available as `blade` snippets) 29 | * Hash 30 | * Helper 31 | * Log 32 | * Mail - Contains `Mail::` and `Mailable::` prefix for mail related settings 33 | * Model - contains archived [Laravel Model](https://github.com/ahinkle/vscode-laravel-model-snippets) snippets 34 | * Passport (Laravel v5.3 - [API Authentication](https://laravel.com/docs/5.3/passport)) 35 | * Redirect 36 | * Relation 37 | * Request 38 | * Response 39 | * Route 40 | * Schema - Contains `Schema::` and `Column::` prefix for database related settings 41 | * Session 42 | * Storage 43 | * Str 44 | * View 45 | 46 | > Blade - Please install [`Laravel Blade Snippets` extension](https://marketplace.visualstudio.com/items?itemName=onecentlin.laravel-blade) for blade syntax highlighting and better support with blade and emmet. 47 | 48 | ## Contact 49 | 50 | Please file any [issues](https://github.com/onecentlin/laravel5-snippets-vscode/issues) or have a suggestion please tweet me [@onecentlin](https://twitter.com/onecentlin). 51 | 52 | ## Credits 53 | 54 | * Snippets based on [Laravel 5 Snippets for Sublime Text](https://github.com/Lykegenes/laravel-5-snippets) 55 | 56 | ## License 57 | 58 | Please read [License](https://github.com/onecentlin/laravel5-snippets-vscode/blob/master/LICENSE.md) for more information. 59 | -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onecentlin/laravel5-snippets-vscode/c47f80f835d273e10f919a51aa7e1cbd436f60cd/images/icon.png -------------------------------------------------------------------------------- /images/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onecentlin/laravel5-snippets-vscode/c47f80f835d273e10f919a51aa7e1cbd436f60cd/images/screenshot.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel5-snippets", 3 | "displayName": "Laravel Snippets", 4 | "description": "Laravel snippets for Visual Studio Code (Support Laravel 5 and above)", 5 | "version": "1.19.1", 6 | "publisher": "onecentlin", 7 | "author": { 8 | "name": "Winnie Lin", 9 | "email": "onecentlin@gmail.com", 10 | "url": "https://devmanna.blogspot.com" 11 | }, 12 | "homepage": "https://github.com/onecentlin/laravel5-snippets-vscode", 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/onecentlin/laravel5-snippets-vscode" 16 | }, 17 | "bugs": { 18 | "url": "https://github.com/onecentlin/laravel5-snippets-vscode/issues" 19 | }, 20 | "engines": { 21 | "vscode": "^1.0.0" 22 | }, 23 | "keywords": [ 24 | "laravel", 25 | "snippet", 26 | "laravel5", 27 | "laravel6", 28 | "laravel7", 29 | "laravel8", 30 | "laravel9", 31 | "laravel10", 32 | "laravel11", 33 | "laravel12" 34 | ], 35 | "icon": "images/icon.png", 36 | "galleryBanner": { 37 | "color": "#f66f62", 38 | "theme": "dark" 39 | }, 40 | "categories": [ 41 | "Snippets" 42 | ], 43 | "contributes": { 44 | "snippets": [ 45 | { 46 | "language": "php", 47 | "path": "./snippets/arr.json" 48 | }, 49 | { 50 | "language": "php", 51 | "path": "./snippets/auth.json" 52 | }, 53 | { 54 | "language": "php", 55 | "path": "./snippets/cache.json" 56 | }, 57 | { 58 | "language": "php", 59 | "path": "./snippets/config.json" 60 | }, 61 | { 62 | "language": "php", 63 | "path": "./snippets/console.json" 64 | }, 65 | { 66 | "language": "php", 67 | "path": "./snippets/cookie.json" 68 | }, 69 | { 70 | "language": "php", 71 | "path": "./snippets/crypt.json" 72 | }, 73 | { 74 | "language": "php", 75 | "path": "./snippets/db.json" 76 | }, 77 | { 78 | "language": "php", 79 | "path": "./snippets/eloquent.json" 80 | }, 81 | { 82 | "language": "php", 83 | "path": "./snippets/event.json" 84 | }, 85 | { 86 | "language": "php", 87 | "path": "./snippets/hash.json" 88 | }, 89 | { 90 | "language": "php", 91 | "path": "./snippets/helper.json" 92 | }, 93 | { 94 | "language": "php", 95 | "path": "./snippets/log.json" 96 | }, 97 | { 98 | "language": "php", 99 | "path": "./snippets/mail.json" 100 | }, 101 | { 102 | "language": "php", 103 | "path": "./snippets/model.json" 104 | }, 105 | { 106 | "language": "php", 107 | "path": "./snippets/redirect.json" 108 | }, 109 | { 110 | "language": "php", 111 | "path": "./snippets/relation.json" 112 | }, 113 | { 114 | "language": "php", 115 | "path": "./snippets/request.json" 116 | }, 117 | { 118 | "language": "php", 119 | "path": "./snippets/response.json" 120 | }, 121 | { 122 | "language": "php", 123 | "path": "./snippets/route.json" 124 | }, 125 | { 126 | "language": "php", 127 | "path": "./snippets/schema.json" 128 | }, 129 | { 130 | "language": "php", 131 | "path": "./snippets/session.json" 132 | }, 133 | { 134 | "language": "php", 135 | "path": "./snippets/storage.json" 136 | }, 137 | { 138 | "language": "php", 139 | "path": "./snippets/view.json" 140 | }, 141 | { 142 | "language": "php", 143 | "path": "./snippets/passport.json" 144 | }, 145 | { 146 | "language": "php", 147 | "path": "./snippets/str.json" 148 | }, 149 | { 150 | "language": "php", 151 | "path": "./snippets/broadcast.json" 152 | }, 153 | { 154 | "language": "blade", 155 | "path": "./snippets/collective_form_html.json" 156 | } 157 | ] 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /snippets/arr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Arr-accessible": { 3 | "prefix": "Arr::accessible", 4 | "body": "Arr::accessible(${1:\\$value})", 5 | "description": "Determine whether the given value is array accessible" 6 | }, 7 | "Arr-add": { 8 | "prefix": "Arr::add", 9 | "body": "Arr::add(${1:\\$array}, '${2:key}', ${3:\\$value})", 10 | "description": "Add an element to an array using 'dot' notation if it doesn't exist" 11 | }, 12 | "Arr-collapse": { 13 | "prefix": "Arr::collapse", 14 | "body": "Arr::collapse(${1:\\$array})", 15 | "description": "Collapse an array of arrays into a single array" 16 | }, 17 | "Arr-crossJoin": { 18 | "prefix": "Arr::crossJoin", 19 | "body": "Arr::crossJoin(...${1:\\$arrays})", 20 | "description": "Cross join the given arrays, returning all possible permutations" 21 | }, 22 | "Arr-divide": { 23 | "prefix": "Arr::divide", 24 | "body": "Arr::divide(${1:\\$array})", 25 | "description": "Divide an array into two arrays. One with keys and the other with values" 26 | }, 27 | "Arr-dot": { 28 | "prefix": "Arr::dot", 29 | "body": "Arr::dot(${1:\\$array}, '${2:prepend}')", 30 | "description": "Flatten a multi-dimensional associative array with dots" 31 | }, 32 | "Arr-undot": { 33 | "prefix": "Arr::undot", 34 | "body": "Arr::undot(${1:\\$array})", 35 | "description": "Convert a flatten 'dot' notation array into an expanded array." 36 | }, 37 | "Arr-except": { 38 | "prefix": "Arr::except", 39 | "body": "Arr::except(${1:\\$array}, ${2:\\$keys})", 40 | "description": "Get all of the given array except for a specified array of keys" 41 | }, 42 | "Arr-exists": { 43 | "prefix": "Arr::exists", 44 | "body": "Arr::exists(${1:\\$array}, '${2:key}')", 45 | "description": "Determine if the given key exists in the provided array." 46 | }, 47 | "Arr-first": { 48 | "prefix": "Arr::first", 49 | "body": "Arr::first(${1:\\$array}, ${2:\\$callback}, ${3:\\$default})", 50 | "description": "Return the first element in an array passing a given truth test" 51 | }, 52 | "Arr-last": { 53 | "prefix": "Arr::last", 54 | "body": "Arr::last(${1:\\$array}, ${2:\\$callback}, ${3:\\$default})", 55 | "description": "Return the last element in an array passing a given truth test" 56 | }, 57 | "Arr-take:": { 58 | "prefix": "Arr::take", 59 | "body": "Arr::take(${1:\\$array}, ${2:\\$limit})", 60 | "description": "Take the first or last limit items from an array. (Laravel v10.x)" 61 | }, 62 | "Arr-flatten": { 63 | "prefix": "Arr::flatten", 64 | "body": "Arr::flatten(${1:\\$array}, ${2:\\$depth})", 65 | "description": "Flatten a multi-dimensional array into a single level" 66 | }, 67 | "Arr-forget": { 68 | "prefix": "Arr::forget", 69 | "body": "Arr::forget(${1:\\$array}, ${2:\\$keys})", 70 | "description": "Remove one or many array items from a given array using 'dot' notation" 71 | }, 72 | "Arr-get": { 73 | "prefix": "Arr::get", 74 | "body": "Arr::get(${1:\\$array}, '${2:key}', ${3:\\$default})", 75 | "description": "Get an item from an array using 'dot' notation" 76 | }, 77 | "Arr-has": { 78 | "prefix": "Arr::has", 79 | "body": "Arr::has(${1:\\$array}, ${2:\\$keys})", 80 | "description": "Check if an item or items exist in an array using 'dot' notation" 81 | }, 82 | "Arr-hasAny": { 83 | "prefix": "Arr::hasAny", 84 | "body": "Arr::hasAny(${1:\\$array}, ${2:\\$keys})", 85 | "description": "Check if an item or items exist in an array using 'dot' notation" 86 | }, 87 | "Arr-isAssoc": { 88 | "prefix": "Arr::isAssoc", 89 | "body": "Arr::isAssoc(${1:\\$array})", 90 | "description": "Determine whether the given value is an associative array" 91 | }, 92 | "Arr-isList": { 93 | "prefix": "Arr::isList", 94 | "body": "Arr::isList(${1:\\$array})", 95 | "description": "Determines if an array is a list." 96 | }, 97 | "Arr-join": { 98 | "prefix": "Arr::join", 99 | "body": "Arr::join(${1:\\$array}, '${2:glue}', '${3:finalGlue}')", 100 | "description": "Join all items using a string. The final items can use a separate glue string. (Laravel v9.x)" 101 | }, 102 | "Arr-keyBy": { 103 | "prefix": "Arr::keyBy", 104 | "body": "Arr::keyBy(${1:\\$array}, '${2:keyBy}')", 105 | "description": "Key an associative array by a field or using a callback (Laravel v9.2)" 106 | }, 107 | "Arr-prependKeysWith": { 108 | "prefix": "Arr::prependKeysWith", 109 | "body": "Arr::prependKeysWith(${1:\\$array}, '${2:prependWith}')", 110 | "description": "Prepend the key names of an associative array. (Laravel v9.x)" 111 | }, 112 | "Arr-only": { 113 | "prefix": "Arr::only", 114 | "body": "Arr::only(${1:\\$array}, ${2:\\$keys})", 115 | "description": "Get a subset of the items from the given array" 116 | }, 117 | "Arr-select": { 118 | "prefix": "Arr::select", 119 | "body": "Arr::select(${1:\\$array}, ${2:\\$keys})", 120 | "description": "Select an array of values from an array. (Laravel v10.x)" 121 | }, 122 | "Arr-pluck": { 123 | "prefix": "Arr::pluck", 124 | "body": "Arr::pluck(${1:\\$array}, '${2:key}')", 125 | "description": "Pluck an array of values from an array" 126 | }, 127 | "Arr-explodePluckParameters": { 128 | "prefix": "Arr::explodePluckParameters", 129 | "body": "Arr::explodePluckParameters(${1:\\$value}, ${2:\\$key})", 130 | "description": "Explode the 'value' and 'key' arguments passed to 'pluck'." 131 | }, 132 | "Arr-map": { 133 | "prefix": "Arr::map", 134 | "body": "Arr::map(${1:\\$array}, ${2:\\$callback})", 135 | "description": "Run a map over each of the items in the array. (Laravel v9.13)" 136 | }, 137 | "Arr-mapWithKeys": { 138 | "prefix": "Arr::mapWithKeys", 139 | "body": "Arr::mapWithKeys(${1:\\$array}, ${2:\\$callback})", 140 | "description": "Run an associative map over each of the items. (Laravel v10.x)" 141 | }, 142 | "Arr-mapSpread": { 143 | "prefix": "Arr::mapSpread", 144 | "body": "Arr::mapSpread(${1:\\$array}, ${2:\\$callback})", 145 | "description": "Run a map over each nested chunk of items. (Laravel v11.x)" 146 | }, 147 | "Arr-prepend": { 148 | "prefix": "Arr::prepend", 149 | "body": "Arr::prepend(${1:\\$array}, ${2:\\$value}, '${3:key}')", 150 | "description": "Push an item onto the beginning of an array" 151 | }, 152 | "Arr-pull": { 153 | "prefix": "Arr::pull", 154 | "body": "Arr::pull(${1:\\$array}, '${2:key}')", 155 | "description": "Get a value from the array, and remove it" 156 | }, 157 | "Arr-query": { 158 | "prefix": "Arr::query", 159 | "body": "Arr::query(${1:\\$array})", 160 | "description": "Convert the array into a query string." 161 | }, 162 | "Arr-random": { 163 | "prefix": "Arr::random", 164 | "body": "Arr::random(${1:\\$array}, ${2:\\$number})", 165 | "description": "Get one or a specified number of random values from an array." 166 | }, 167 | "Arr-set": { 168 | "prefix": "Arr::set", 169 | "body": "Arr::set(${1:\\$array}, '${2:key}', ${3:\\$value})", 170 | "description": "Set an array item to a given value using 'dot' notation" 171 | }, 172 | "Arr-Shuffle": { 173 | "prefix": "Arr::shuffle", 174 | "body": "Arr::shuffle(${1:\\$array})", 175 | "description": "Shuffle the given array and return the result" 176 | }, 177 | "Arr-sole": { 178 | "prefix": "Arr::sole", 179 | "body": "Arr::sole(${1:\\$array}, ${2:\\$callback})", 180 | "description": "Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. (Laravel v12.x)" 181 | }, 182 | "Arr-sort": { 183 | "prefix": "Arr::sort", 184 | "body": "Arr::sort(${1:\\$array}, ${2:\\$callback})", 185 | "description": "Sort the array using the given callback or 'dot' notation." 186 | }, 187 | "Arr-sortDesc": { 188 | "prefix": "Arr::sortDesc", 189 | "body": "Arr::sortDesc(${1:\\$array}, ${2:\\$callback})", 190 | "description": "Sort the array in descending order using the given callback or 'dot' notation. (Laravel v9.x)" 191 | }, 192 | "Arr-sortRecursive": { 193 | "prefix": "Arr::sortRecursive", 194 | "body": "Arr::sortRecursive(${1:\\$array})", 195 | "description": "Recursively sort an array by keys and values." 196 | }, 197 | "Arr-sortRecursiveDesc": { 198 | "prefix": "Arr::sortRecursiveDesc", 199 | "body": "Arr::sortRecursiveDesc(${1:\\$array})", 200 | "description": "Recursively sort an array by keys and values in descending order. (Laravel v10.x)" 201 | }, 202 | "Arr-toCssStyles": { 203 | "prefix": "Arr::toCssStyles", 204 | "body": "Arr::toCssStyles(${1:\\$array})", 205 | "description": "Conditionally compile styles from an array into a style list. (Laravel v9.x)" 206 | }, 207 | "Arr-where": { 208 | "prefix": "Arr::where", 209 | "body": "Arr::where(${1:\\$array}, ${2:\\$callback})", 210 | "description": "Filter the array using the given callback." 211 | }, 212 | "Arr-reject": { 213 | "prefix": "Arr::reject", 214 | "body": "Arr::reject(${1:\\$array}, ${2:\\$callback})", 215 | "description": "Filter the array using the given callback. (Laravel v11.x)" 216 | }, 217 | "Arr-partition": { 218 | "prefix": "Arr::partition", 219 | "body": "Arr::partition(${1:\\$array}, ${2:\\$callback})", 220 | "description": "Partition the array into two arrays using the given callback. (Laravel v12.x)" 221 | }, 222 | "Arr-whereNotNull": { 223 | "prefix": "Arr::whereNotNull", 224 | "body": "Arr::whereNotNull(${1:\\$array})", 225 | "description": "Filter items in the array by a callback." 226 | }, 227 | "Arr-wrap": { 228 | "prefix": "Arr::wrap", 229 | "body": "Arr::wrap(${1:\\$value})", 230 | "description": "If the given value is not an array, wrap it in one." 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /snippets/auth.json: -------------------------------------------------------------------------------- 1 | { 2 | "Auth-check.sublime-snippet": { 3 | "prefix": "Auth::check", 4 | "body": [ 5 | "Auth::check()" 6 | ], 7 | "description": "Determine if the current user is authenticated." 8 | }, 9 | "Auth-guest.sublime-snippet": { 10 | "prefix": "Auth::guest", 11 | "body": [ 12 | "Auth::guest()" 13 | ], 14 | "description": "Determine if the current user is a guest." 15 | }, 16 | "Auth-logout.sublime-snippet": { 17 | "prefix": "Auth::logout", 18 | "body": [ 19 | "Auth::logout();" 20 | ], 21 | "description": "Log the user out of the application." 22 | }, 23 | "Auth-user.sublime-snippet": { 24 | "prefix": "Auth::user", 25 | "body": [ 26 | "Auth::user()" 27 | ], 28 | "description": "Get the currently authenticated user." 29 | }, 30 | "Auth-guard": { 31 | "prefix": "Auth::guard", 32 | "body": [ 33 | "Auth::guard('${1:guardName}')$2" 34 | ], 35 | "description": "customize the \"guard\" that is used to authenticate and register users" 36 | }, 37 | "Auth-attempt": { 38 | "prefix": "Auth::attempt", 39 | "body": [ 40 | "Auth::attempt([${1:'email' => \\$email, 'password' => \\$password}])$2" 41 | ], 42 | "description": "Log by passing an array with key-value" 43 | }, 44 | "Auth-login": { 45 | "prefix": "Auth::login", 46 | "body": [ 47 | "Auth::login(${1:\\$user});$2" 48 | ], 49 | "description": "Log an existing user instance into your application" 50 | }, 51 | "Auth-loginUsingId": { 52 | "prefix": "Auth::loginUsingId", 53 | "body": [ 54 | "Auth::loginUsingId($1);$2" 55 | ], 56 | "description": "To log a user into the application by their ID" 57 | }, 58 | "Auth-viaRemember": { 59 | "prefix": "Auth::viaRemember", 60 | "body": [ 61 | "Auth::viaRemember()" 62 | ], 63 | "description": "Determine if the user was authenticated using the \"remember me\" cookie." 64 | }, 65 | "Auth-routes": { 66 | "prefix": "Auth::routes", 67 | "body": [ 68 | "Auth::routes();" 69 | ], 70 | "description": "Set authentication routes (v5.3)" 71 | } 72 | } -------------------------------------------------------------------------------- /snippets/broadcast.json: -------------------------------------------------------------------------------- 1 | { 2 | "Broadcast-channel": { 3 | "prefix": "Broadcast::channel", 4 | "body": "Broadcast::channel('${1}', ${2}::class);${3}", 5 | "description": "Broadcast Channel Classes" 6 | } 7 | } -------------------------------------------------------------------------------- /snippets/cache.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cache-add.sublime-snippet": { 3 | "prefix": "Cache::add", 4 | "body": [ 5 | "Cache::add('${1:key}', ${2:\\$value}, ${3:\\$ttl});$4" 6 | ], 7 | "description": "Store an item in the Cache if it doesn't exist." 8 | }, 9 | "Cache-decrement.sublime-snippet": { 10 | "prefix": "Cache::decrement", 11 | "body": [ 12 | "Cache::decrement('${1:key}', ${2:\\$amount});$3" 13 | ], 14 | "description": "Decrement a Cached value" 15 | }, 16 | "Cache-flush.sublime-snippet": { 17 | "prefix": "Cache::flush", 18 | "body": [ 19 | "Cache::flush();" 20 | ], 21 | "description": "Remove all items from the cache." 22 | }, 23 | "Cache-forever.sublime-snippet": { 24 | "prefix": "Cache::forever", 25 | "body": [ 26 | "Cache::forever('${1:key}', ${2:\\$value});$3" 27 | ], 28 | "description": "Store an item in the Cache Permanently" 29 | }, 30 | "Cache-forget.sublime-snippet": { 31 | "prefix": "Cache::forget", 32 | "body": [ 33 | "Cache::forget('${1:key}');$2" 34 | ], 35 | "description": "Remove an Item from the Cache" 36 | }, 37 | "Cache-get.sublime-snippet": { 38 | "prefix": "Cache::get", 39 | "body": [ 40 | "Cache::get('${1:key}', '${2:default}');$3" 41 | ], 42 | "description": "Retrieve an Item from the Cache" 43 | }, 44 | "Cache-has.sublime-snippet": { 45 | "prefix": "Cache::has", 46 | "body": [ 47 | "Cache::has('${1:key}')$2" 48 | ], 49 | "description": "Check for existence in Cache" 50 | }, 51 | "Cache-increment.sublime-snippet": { 52 | "prefix": "Cache::increment", 53 | "body": [ 54 | "Cache::increment('${1:key}', ${2:\\$amount});$3" 55 | ], 56 | "description": "Increment a Cached value" 57 | }, 58 | "Cache-pull.sublime-snippet": { 59 | "prefix": "Cache::pull", 60 | "body": [ 61 | "Cache::pull('${1:key}');$2" 62 | ], 63 | "description": "Pulling An Item From The Cache" 64 | }, 65 | "Cache-put.sublime-snippet": { 66 | "prefix": "Cache::put", 67 | "body": [ 68 | "Cache::put('${1:key}', ${2:\\$value}, ${3:\\$ttl});$4" 69 | ], 70 | "description": "Store an item in the Cache (key, value, ttl)" 71 | }, 72 | "Cache-remember.sublime-snippet": { 73 | "prefix": "Cache::remember", 74 | "body": [ 75 | "Cache::remember('${1:key}', ${2:\\$ttl}, function () {", 76 | " $3", 77 | "});" 78 | ], 79 | "description": "Retrieve item or Store a default value if it doesn't exist" 80 | }, 81 | "Cache-rememberForever.sublime-snippet": { 82 | "prefix": "Cache::rememberForever", 83 | "body": [ 84 | "Cache::rememberForever('${1:key}', function () {", 85 | " $2", 86 | "});" 87 | ], 88 | "description": "Retrieve item or Store a default value permanently" 89 | }, 90 | "Cache-lock-get": { 91 | "prefix": "Cache::lock-get", 92 | "body": "Cache::lock('${1:lock-name}', ${2:60})->get()", 93 | "description": "obtaining arbitrary locks" 94 | }, 95 | "Cache-lock-release": { 96 | "prefix": "Cache::lock-release", 97 | "body": "Cache::lock('${1:lock-name}')->release()", 98 | "description": "release locks" 99 | }, 100 | "Cache-lock-block": { 101 | "prefix": "Cache::lock-block", 102 | "body": "Cache::lock('${1:lock-name}', ${2:60})->block(${3:10})", 103 | "description": "block until the lock becomes available" 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /snippets/collective_form_html.json: -------------------------------------------------------------------------------- 1 | { 2 | "Form-checkbox": { 3 | "prefix": "Form::checkbox", 4 | "body": [ 5 | "{!! Form::checkbox(${1:$$name}, ${2:$$value}, ${3:$$checked}, [${4:$$options}]) !!}" 6 | ], 7 | "description": "Create a checkbox input field." 8 | }, 9 | "Form-close": { 10 | "prefix": "Form::close", 11 | "body": [ 12 | "{!! Form::close(${1}) !!}" 13 | ], 14 | "description": "Closes a form tag" 15 | }, 16 | "Form-date": { 17 | "prefix": "Form::date", 18 | "body": [ 19 | "{!! Form::date(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 20 | ], 21 | "description": "Create a date input field" 22 | }, 23 | "Form-datetime": { 24 | "prefix": "Form::datetime", 25 | "body": [ 26 | "{!! Form::datetime(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 27 | ], 28 | "description": "Create a datetime input field" 29 | }, 30 | "Form-datetimeLocal": { 31 | "prefix": "Form::datetimeLocal", 32 | "body": [ 33 | "{!! Form::datetimeLocal(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 34 | ], 35 | "description": "Create a datetime-local input field" 36 | }, 37 | "Form-email": { 38 | "prefix": "Form::email", 39 | "body": [ 40 | "{!! Form::email(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 41 | ], 42 | "description": "Create an e-mail input field" 43 | }, 44 | "Form-file": { 45 | "prefix": "Form::file", 46 | "body": [ 47 | "{!! Form::file(${1:$$name}, [${2:$$options}]) !!}" 48 | ], 49 | "description": "Create a file input field" 50 | }, 51 | "Form-hidden": { 52 | "prefix": "Form::hidden", 53 | "body": [ 54 | "{!! Form::hidden(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 55 | ], 56 | "description": "Create a hidden input field" 57 | }, 58 | "Form-label": { 59 | "prefix": "Form::label", 60 | "body": [ 61 | "{!! Form::label(${1:$$for}, ${2:$$text}, [${3:$$options}]) !!}" 62 | ], 63 | "description": "Create a form label element." 64 | }, 65 | "Form-model": { 66 | "prefix": "Form::model", 67 | "body": [ 68 | "{!! Form::model(${1:$$user}, [${2:$$options}]) !!}" 69 | ], 70 | "description": "Create a new model based form builder." 71 | }, 72 | "Form-number": { 73 | "prefix": "Form::number", 74 | "body": [ 75 | "{!! Form::number(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 76 | ], 77 | "description": "Create a number input field" 78 | }, 79 | "Form-open": { 80 | "prefix": "Form::open", 81 | "body": [ 82 | "{!! Form::open(${1}) !!}" 83 | ], 84 | "description": "Open up a new HTML form" 85 | }, 86 | "Form-password": { 87 | "prefix": "Form::password", 88 | "body": [ 89 | "{!! Form::password(${1:$$name}, [${2:$$options}]) !!}" 90 | ], 91 | "description": "Create a password input field" 92 | }, 93 | "Form-radio": { 94 | "prefix": "Form::radio", 95 | "body": [ 96 | "{!! Form::radio(${1:$$name}, ${2:$$value}, ${3:$$checked}, [${4:$$options}]) !!}" 97 | ], 98 | "description": "Create a radio button input field" 99 | }, 100 | "Form-select": { 101 | "prefix": "Form::select", 102 | "body": [ 103 | "{!! Form::select(${1:$$name}, ${2:$$list}, ${3:$$selected}, [${4:$$options}]) !!}" 104 | ], 105 | "description": "Create a select box field" 106 | }, 107 | "Form-selectMonth": { 108 | "prefix": "Form::selectMonth", 109 | "body": [ 110 | "{!! Form::selectMonth(${1:$$name}, ${2:$$selected}, [${3:$$options}]) !!}" 111 | ], 112 | "description": "Create a select month field" 113 | }, 114 | "Form-selectRange": { 115 | "prefix": "Form::selectRange", 116 | "body": [ 117 | "{!! Form::selectRange(${1:$$name}, ${2:$$min}, ${3:$$max}), ${4:$$selected}, [${5:$$options} !!}" 118 | ], 119 | "description": "Create a select range field" 120 | }, 121 | "Form-submit": { 122 | "prefix": "Form::submit", 123 | "body": [ 124 | "{!! Form::submit(${1:$$text}, [${2:$$options}]) !!}" 125 | ], 126 | "description": "Create a submit button element" 127 | }, 128 | "Form-text": { 129 | "prefix": "Form::text", 130 | "body": [ 131 | "{!! Form::text(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 132 | ], 133 | "description": "Create a text input field" 134 | }, 135 | "Form-textarea": { 136 | "prefix": "Form::textarea", 137 | "body": [ 138 | "{!! Form::textarea(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 139 | ], 140 | "description": "Create a textarea input field" 141 | }, 142 | "Form-time": { 143 | "prefix": "Form::time", 144 | "body": [ 145 | "{!! Form::time(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 146 | ], 147 | "description": "Create a time input field" 148 | }, 149 | "Form-token": { 150 | "prefix": "Form::token", 151 | "body": [ 152 | "{!! Form::token(${1}) !!}" 153 | ], 154 | "description": "Generate a hidden field with the current CSRF token" 155 | }, 156 | "Form-url": { 157 | "prefix": "Form::url", 158 | "body": [ 159 | "{!! Form::url(${1:$$name}, ${2:$$value}, [${3:$$options}]) !!}" 160 | ], 161 | "description": "Create a url input field" 162 | }, 163 | "link_to": { 164 | "prefix": "link_to", 165 | "body": [ 166 | "{!! link_to(${1:$url}, ${2:$title = null}, ${3:$attributes = []}, ${4:$secure = null}, ${5:$escape = true}) !!}" 167 | ], 168 | "description": "Generate an HTML link" 169 | }, 170 | "link_to_asset": { 171 | "prefix": "link_to_asset", 172 | "body": [ 173 | "{!! link_to_asset(${1:$url}, ${2:$title = null}, ${3:$attributes = []}, ${4:$secure = null}) !!}" 174 | ], 175 | "description": "Generate an HTML link to an asset" 176 | }, 177 | "link_to_route": { 178 | "prefix": "link_to_route", 179 | "body": [ 180 | "{!! link_to_route(${1:$name}, ${2:$title = null}, ${3:$parameters = []}, ${4:$attributes = []}) !!}" 181 | ], 182 | "description": "Generate an HTML link to a named route" 183 | }, 184 | "link_to_action": { 185 | "prefix": "link_to_action", 186 | "body": [ 187 | "{!! link_to_action(${1:$action}, ${2:$title = null}, ${3:$parameters = []}, ${4:$attributes = []}) !!}" 188 | ], 189 | "description": "Generate an HTML link to a controller action" 190 | } 191 | } -------------------------------------------------------------------------------- /snippets/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Config-all.sublime-snippet": { 3 | "prefix": "Config::all", 4 | "body": [ 5 | "Config::all();" 6 | ], 7 | "description": "Get all of the configuration items for the application." 8 | }, 9 | "Config-get.sublime-snippet": { 10 | "prefix": "Config::get", 11 | "body": [ 12 | "Config::get('${1:key}', '${2:default}');$3" 13 | ], 14 | "description": "Get the specified configuration value." 15 | }, 16 | "Config-has.sublime-snippet": { 17 | "prefix": "Config::has", 18 | "body": [ 19 | "Config::has('${1:key}')$2" 20 | ], 21 | "description": "Determine if the given configuration value exists." 22 | }, 23 | "Config-set.sublime-snippet": { 24 | "prefix": "Config::set", 25 | "body": [ 26 | "Config::set('${1:key}', ${2:\\$value});$3" 27 | ], 28 | "description": "Set a given configuration value." 29 | }, 30 | "Config-setMany.sublime-snippet": { 31 | "prefix": "Config::setMany", 32 | "body": [ 33 | "Config::set([", 34 | " '${1:key}' => ${2:\\$value},$3", 35 | "]);$4" 36 | ], 37 | "description": "Set a given configuration value." 38 | } 39 | } -------------------------------------------------------------------------------- /snippets/console.json: -------------------------------------------------------------------------------- 1 | { 2 | "Command-anticipate.sublime-snippet": { 3 | "prefix": "Console::anticipate", 4 | "body": [ 5 | "\\$this->anticipate('${1:Message}');$2" 6 | ], 7 | "description": "Give the user options for repsonse" 8 | }, 9 | "Command-ask.sublime-snippet": { 10 | "prefix": "Console::ask", 11 | "body": [ 12 | "\\$this->ask('${1:Question}');$2" 13 | ], 14 | "description": "Prompts the user with a question in the console" 15 | }, 16 | "Command-choice.sublime-snippet": { 17 | "prefix": "Console::choice", 18 | "body": [ 19 | "\\$this->choice('${1:Question?}', [${2'Choice1', 'Choice2'}], ${3:\\$default});$4" 20 | ], 21 | "description": "Give the user a predefined set of choices" 22 | }, 23 | "Command-comment.sublime-snippet": { 24 | "prefix": "Console::comment", 25 | "body": [ 26 | "\\$this->comment('${1:Message}');$2" 27 | ], 28 | "description": "Log a comment to the console" 29 | }, 30 | "Command-confirm.sublime-snippet": { 31 | "prefix": "", 32 | "body": [ 33 | "\\$this->confirm('${1:Do you wish to continue? [Y|N]}');$2" 34 | ], 35 | "description": "Logs a confirmation prompt to the console" 36 | }, 37 | "Command-error.sublime-snippet": { 38 | "prefix": "Console::error", 39 | "body": [ 40 | "\\$this->error('${1:Message}');$2" 41 | ], 42 | "description": "Log error to the console in red" 43 | }, 44 | "Command-info.sublime-snippet": { 45 | "prefix": "Console::info", 46 | "body": [ 47 | "\\$this->info('${1:Message}');$2" 48 | ], 49 | "description": "Log information to the console in green" 50 | }, 51 | "Command-line.sublime-snippet": { 52 | "prefix": "Console::line", 53 | "body": [ 54 | "\\$this->line('${1:Display this on the screen}');$2" 55 | ], 56 | "description": "Log plain information to the console" 57 | }, 58 | "Command-option.sublime-snippet": { 59 | "prefix": "Console::option", 60 | "body": [ 61 | "\\$this->option('$1');$2" 62 | ], 63 | "description": "Get an option from constructor" 64 | }, 65 | "Command-question.sublime-snippet": { 66 | "prefix": "Console::question", 67 | "body": [ 68 | "\\$this->question('${1:Message}');$2" 69 | ], 70 | "description": "Logs a question to the console" 71 | }, 72 | "Command-secret.sublime-snippet": { 73 | "prefix": "Console::secret", 74 | "body": [ 75 | "\\$this->secret('${1:What is the password?}');$2" 76 | ], 77 | "description": "Prompt the user for hidden input" 78 | }, 79 | "Command-table.sublime-snippet": { 80 | "prefix": "Console::table", 81 | "body": [ 82 | "\\$this->table('${1:\\$header}, ${2:\\$row}');$3" 83 | ], 84 | "description": "Prints a nicely formatted table to the console" 85 | }, 86 | "Command-warn.sublime-snippet": { 87 | "prefix": "Console::warn", 88 | "body": [ 89 | "\\$this->warn('${1:Message}');$2" 90 | ], 91 | "description": "Logs a warn message to the console" 92 | } 93 | } -------------------------------------------------------------------------------- /snippets/cookie.json: -------------------------------------------------------------------------------- 1 | { 2 | "Cookie-forever.sublime-snippet": { 3 | "prefix": "Cookie::forever", 4 | "body": [ 5 | "\\$response->withCookie(cookie()->forever('${1:key}', ${2:\\$value}));$3" 6 | ], 7 | "description": "Make a Permanent Cookie" 8 | }, 9 | "Cookie-get.sublime-snippet": { 10 | "prefix": "Cookie::get", 11 | "body": [ 12 | "\\$request->cookie('${1:key}');$2" 13 | ], 14 | "description": "Retrieve a Cookie value" 15 | }, 16 | "Cookie-set.sublime-snippet": { 17 | "prefix": "Cookie::set", 18 | "body": [ 19 | "\\$response->withCookie(cookie('${1:key}', ${2:\\$value}));$3" 20 | ], 21 | "description": "Attach a Cookie to a Response." 22 | } 23 | } -------------------------------------------------------------------------------- /snippets/crypt.json: -------------------------------------------------------------------------------- 1 | { 2 | "Crypt-decrypt.sublime-snippet": { 3 | "prefix": "Crypt::decrypt", 4 | "body": [ 5 | "try {", 6 | " ${1:\\$decrypted} = Crypt::decrypt(${2:\\$encryptedValue});", 7 | "} catch (Illuminate\\Contracts\\Encryption\\DecryptException $e) {", 8 | " $3", 9 | "}$4" 10 | ], 11 | "description": "Decrypt a value" 12 | }, 13 | "Crypt-encrypt.sublime-snippet": { 14 | "prefix": "Crypt::encrypt", 15 | "body": [ 16 | "Crypt::encrypt(${1:\\$value});$2" 17 | ], 18 | "description": "Encrypt a value" 19 | } 20 | } -------------------------------------------------------------------------------- /snippets/db.json: -------------------------------------------------------------------------------- 1 | { 2 | "DB-delete.sublime-snippet": { 3 | "prefix": "DB::delete", 4 | "body": [ 5 | "DB::delete(${1:'delete users where name = ?'}${2:, ['John']})$3" 6 | ], 7 | "description": "Run an delete statement against the database." 8 | }, 9 | "DB-insert.sublime-snippet": { 10 | "prefix": "DB::insert", 11 | "body": [ 12 | "DB::insert(${1:'insert into users (id, name) values (?, ?)'}${2:, [1, 'Dayle']})$3" 13 | ], 14 | "description": "Run an insert statement against the database." 15 | }, 16 | "DB-select.sublime-snippet": { 17 | "prefix": "DB::select", 18 | "body": [ 19 | "DB::select(${1:'select * from users where active = ?'}${2:, [1]})$3" 20 | ], 21 | "description": "Run a select statement against the database." 22 | }, 23 | "DB-statement.sublime-snippet": { 24 | "prefix": "DB::select", 25 | "body": [ 26 | "DB::statement(${1:'drop table users'})$2" 27 | ], 28 | "description": "Execute an SQL statement and return the boolean result." 29 | }, 30 | "DB-transaction-begin.sublime-snippet": { 31 | "prefix": "DB::transaction_begin", 32 | "body": [ 33 | "DB::beginTransaction();" 34 | ], 35 | "description": "Start a new database transaction." 36 | }, 37 | "DB-transaction-commit.sublime-snippet": { 38 | "prefix": "DB::transaction_commit", 39 | "body": [ 40 | "DB::commit();" 41 | ], 42 | "description": "Commit the active database transaction." 43 | }, 44 | "DB-transaction-rollback.sublime-snippet": { 45 | "prefix": "DB::transaction_rollback", 46 | "body": [ 47 | "DB::rollback();" 48 | ], 49 | "description": "Rollback the active database transaction." 50 | }, 51 | "DB-transaction.sublime-snippet": { 52 | "prefix": "DB::transaction", 53 | "body": [ 54 | "DB::transaction(function () {", 55 | " $1", 56 | "});$2" 57 | ], 58 | "description": "Execute a Closure within a transaction." 59 | }, 60 | "DB-update.sublime-snippet": { 61 | "prefix": "DB::update", 62 | "body": [ 63 | "DB::update(${1:'update users set votes = 100 where name = ?'}${2:, ['John']});$3" 64 | ], 65 | "description": "Run an update statement against the database." 66 | }, 67 | "DB-table": { 68 | "prefix": "DB::table", 69 | "body": [ 70 | "DB::table('${1:users}')$2" 71 | ], 72 | "description": "Retrieving rows from a table" 73 | } 74 | } -------------------------------------------------------------------------------- /snippets/eloquent.json: -------------------------------------------------------------------------------- 1 | { 2 | "eloquent-getter": { 3 | "prefix": "Eloquent-getter", 4 | "body": [ 5 | "public function get${1:Name}Attribute(\\$value) {", 6 | " return ${2:strtoupper(\\$value)};", 7 | "}" 8 | ], 9 | "description": "Eloquent getter (Laravel 5.1+)" 10 | }, 11 | "eloquent-setter": { 12 | "prefix": "Eloquent-setter", 13 | "body": [ 14 | "public function set${1:Name}Attribute(\\$value) {", 15 | " \\$this->attributes['${2:column}'] = ${3:\\$value};", 16 | "}" 17 | ], 18 | "description": "Eloquent setter (Laravel 5.1+)" 19 | }, 20 | "eloquent-attribute": { 21 | "prefix": "Eloquent-attribute", 22 | "body": [ 23 | "public function ${1:name}(): Attribute", 24 | "{", 25 | " return new Attribute(", 26 | " get: fn (\\$value) => ${2:strtoupper(\\$value)},", 27 | " set: fn (\\$value) => ${3:\\$value},", 28 | " );", 29 | "}" 30 | ], 31 | "description": "Eloquent accessors / mutators (Laravel 9.x)" 32 | }, 33 | "eloquent-attribute-make": { 34 | "prefix": "Eloquent-attribute-make", 35 | "body": [ 36 | "public function ${1:name}(): Attribute", 37 | "{", 38 | " return Attribute::make(", 39 | " get: fn (\\$value) => ${2:\\$value},", 40 | " set: fn (\\$value) => ${3:\\$value},", 41 | " );", 42 | "}" 43 | ], 44 | "description": "Eloquent accessors / mutators (Laravel 9.x)" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /snippets/event.json: -------------------------------------------------------------------------------- 1 | { 2 | "Event-createClassListener.sublime-snippet": { 3 | "prefix": "Event::createClassListener", 4 | "body": [ 5 | "Event::createClassListener(${1:listener});$2" 6 | ], 7 | "description": "Create a class based listener using the IoC container." 8 | }, 9 | "Event-fire.sublime-snippet": { 10 | "prefix": "Event::fire", 11 | "body": [ 12 | "Event::fire(${1:new MyCustomEvent()});$2" 13 | ], 14 | "description": "Fire an event and call the listeners." 15 | }, 16 | "Event-firing.sublime-snippet": { 17 | "prefix": "Event::firing", 18 | "body": [ 19 | "Event::firing();" 20 | ], 21 | "description": "Get the event that is currently firing." 22 | }, 23 | "Event-flush.sublime-snippet": { 24 | "prefix": "Event::flush", 25 | "body": [ 26 | "Event::flush('${1:event}');$2" 27 | ], 28 | "description": "Flush a set of pushed events." 29 | }, 30 | "Event-forget.sublime-snippet": { 31 | "prefix": "Event::forget", 32 | "body": [ 33 | "Event::forget('${1:event}');$2" 34 | ], 35 | "description": "Remove a set of listeners from the dispatcher." 36 | }, 37 | "Event-getListeners.sublime-snippet": { 38 | "prefix": "Event::getListeners", 39 | "body": [ 40 | "Event::getListeners('${1:eventName}');$2" 41 | ], 42 | "description": "Get all of the listeners for a given event name." 43 | }, 44 | "Event-hasListeners.sublime-snippet": { 45 | "prefix": "Event::hasListeners", 46 | "body": [ 47 | "Event::hasListeners('${1:eventName}');$2" 48 | ], 49 | "description": "Determine if a given event has listeners." 50 | }, 51 | "Event-listen.sublime-snippet": { 52 | "prefix": "Event::listen", 53 | "body": [ 54 | "Event::listen(${1:events}, ${2:listener}, ${3:priority});$4" 55 | ], 56 | "description": "Register an event listener with the dispatcher." 57 | }, 58 | "Event-makeListener.sublime-snippet": { 59 | "prefix": "Event::makeListener", 60 | "body": [ 61 | "Event::makeListener(${1:listener});$2" 62 | ], 63 | "description": "Register an event listener with the dispatcher." 64 | }, 65 | "Event-push.sublime-snippet": { 66 | "prefix": "Event::push", 67 | "body": [ 68 | "Event::push(${1:event}, ${2:payload});$3" 69 | ], 70 | "description": "Register an event and payload to be fired later." 71 | }, 72 | "Event-subscribe.sublime-snippet": { 73 | "prefix": "Event::subscribe", 74 | "body": [ 75 | "Event::subscribe(${1:subscriber});$2" 76 | ], 77 | "description": "Register an event subscriber with the dispatcher." 78 | }, 79 | "Event-until.sublime-snippet": { 80 | "prefix": "Event::until", 81 | "body": [ 82 | "Event::until(${1:event}, ${2:payload});$3" 83 | ], 84 | "description": "Fire an event until the first non-null response is returned." 85 | } 86 | } -------------------------------------------------------------------------------- /snippets/hash.json: -------------------------------------------------------------------------------- 1 | { 2 | "Hash-check.sublime-snippet": { 3 | "prefix": "Hash::check", 4 | "body": [ 5 | "Hash::check(${1:\\$value}, ${2:\\$hashedValue})$3" 6 | ], 7 | "description": "Check the given plain value against a hash." 8 | }, 9 | "Hash-make.sublime-snippet": { 10 | "prefix": "Hash::make", 11 | "body": [ 12 | "Hash::make(${1:\\$value})$2" 13 | ], 14 | "description": "Hash the given value." 15 | }, 16 | "Hash-needsRehash.sublime-snippet": { 17 | "prefix": "Hash::needsRehash", 18 | "body": [ 19 | "if (Hash::needsRehash(${1:\\$hashedValue}))", 20 | "{", 21 | " ${2:\\$hashed} = Hash::make(${3:\\$value});", 22 | "}$4" 23 | ], 24 | "description": "Check if the given hash has been hashed using the given options." 25 | } 26 | } -------------------------------------------------------------------------------- /snippets/helper.json: -------------------------------------------------------------------------------- 1 | { 2 | "Helper-array-add.sublime-snippet": { 3 | "prefix": "Helper::array_add", 4 | "body": [ 5 | "array_add(${1:\\$array}, ${2:'key'}, ${3:'value'})" 6 | ], 7 | "description": "Add an element to an array using \"dot\" notation if it doesn't exist." 8 | }, 9 | "Helper-array-collapse.sublime-snippet": { 10 | "prefix": "Helper::array_collapse", 11 | "body": [ 12 | "array_collapse(${1:\\$array})" 13 | ], 14 | "description": "Collapse an array of arrays into a single array." 15 | }, 16 | "Helper-array-data_get.sublime-snippet": { 17 | "prefix": "Helper::array-data_get", 18 | "body": [ 19 | "data_get(${1:\\$array}, ${2:'names.john'}, ${3:'default'})" 20 | ], 21 | "description": "Get an item from an array using \"dot\" notation." 22 | }, 23 | "Helper-array-divide.sublime-snippet": { 24 | "prefix": "Helper::array_divide", 25 | "body": [ 26 | "list(${1:\\$keys}, ${2:\\$values}) = array_divide(${3:\\$array});" 27 | ], 28 | "description": "Divide an array into two arrays. One with keys and the other with values." 29 | }, 30 | "Helper-array-dot.sublime-snippet": { 31 | "prefix": "Helper::array_dot", 32 | "body": [ 33 | "array_dot(${1:\\$array})" 34 | ], 35 | "description": "Flatten a multi-dimensional associative array with dots." 36 | }, 37 | "Helper-array-end.sublime-snippet": { 38 | "prefix": "Helper::array_last", 39 | "body": [ 40 | "last(${1:\\$array})" 41 | ], 42 | "description": "Get the last element of an array. Useful for method chaining." 43 | }, 44 | "Helper-array-except.sublime-snippet": { 45 | "prefix": "Helper::array_except", 46 | "body": [ 47 | "array_except(${1:\\$array}, ${2:['key', 'otherKey']})" 48 | ], 49 | "description": "Get all of the given array except for a specified array of items." 50 | }, 51 | "Helper-array-first.sublime-snippet": { 52 | "prefix": "Helper::array_first", 53 | "body": [ 54 | "array_first(${1:\\$array}, function (${2:\\$key}, ${3:\\$value}) {", 55 | " return ${4:\\$value >= 150;}", 56 | "});" 57 | ], 58 | "description": "Return the first element in an array passing a given truth test." 59 | }, 60 | "Helper-array-flatten.sublime-snippet": { 61 | "prefix": "Helper::array_flatten", 62 | "body": [ 63 | "array_flatten(${1:\\$array})" 64 | ], 65 | "description": "Will flatten a multi-dimensional array into a single level." 66 | }, 67 | "Helper-array-forget.sublime-snippet": { 68 | "prefix": "Helper::array_forget", 69 | "body": [ 70 | "array_forget(${1:\\$array}, ${2:'names.joe'})" 71 | ], 72 | "description": "Remove one or many array items from a given array using \"dot\" notation." 73 | }, 74 | "Helper-array-get.sublime-snippet": { 75 | "prefix": "Helper::array_get", 76 | "body": [ 77 | "array_get(${1:\\$array}, ${2:'names.john'}, ${3:'default'})" 78 | ], 79 | "description": "Get an item from an array using \"dot\" notation." 80 | }, 81 | "Helper-array-has.sublime-snippet": { 82 | "prefix": "Helper::array_has", 83 | "body": [ 84 | "array_has(${1:\\$array}, ${2:key})$3" 85 | ], 86 | "description": "Check if an item exists in an array using \"dot\" notation." 87 | }, 88 | "Helper-array-head.sublime-snippet": { 89 | "prefix": "Helper::array-head", 90 | "body": [ 91 | "head(${1:\\$array})" 92 | ], 93 | "description": "Get the first element of an array. Useful for method chaining." 94 | }, 95 | "Helper-array-last.sublime-snippet": { 96 | "prefix": "Helper::array_last", 97 | "body": [ 98 | "array_last(${1:\\$array}, function (${2:\\$key}, ${3:\\$value}) {", 99 | " return ${4:\\$value >= 150;}", 100 | "});" 101 | ], 102 | "description": "Return the last element in an array passing a given truth test." 103 | }, 104 | "Helper-array-only.sublime-snippet": { 105 | "prefix": "Helper::array_only", 106 | "body": [ 107 | "array_only(${1:\\$array}, ${2:['key', 'otherKey']})" 108 | ], 109 | "description": "Get a subset of the items from the given array." 110 | }, 111 | "Helper-array-pluck.sublime-snippet": { 112 | "prefix": "Helper::array_pluck", 113 | "body": [ 114 | "array_pluck(${1:\\$array}, ${2:'value'})" 115 | ], 116 | "description": "Pluck an array of values from an array." 117 | }, 118 | "Helper-array-prepend.sublime-snippet": { 119 | "prefix": "Helper::array_prepend", 120 | "body": [ 121 | "array_prepend(${1:\\$array}, ${2:'value'})" 122 | ], 123 | "description": "Push an item onto the beginning of an array." 124 | }, 125 | "Helper-array-pull.sublime-snippet": { 126 | "prefix": "Helper::array_pull", 127 | "body": [ 128 | "array_pull(${1:\\$array}, ${2:'value'})" 129 | ], 130 | "description": "Get a value from the array, and remove it." 131 | }, 132 | "Helper-array-set.sublime-snippet": { 133 | "prefix": "Helper::array_set", 134 | "body": [ 135 | "array_set(${1:\\$array}, ${2:'products.desk.price'}, ${3:200})" 136 | ], 137 | "description": "Set an array item to a given value using \"dot\" notation." 138 | }, 139 | "Helper-array-sort-recursive.sublime-snippet": { 140 | "prefix": "Helper::array_sort_recursive", 141 | "body": [ 142 | "array_sort_recursive(${1:\\$array});" 143 | ], 144 | "description": "Recursively sort an array by keys and values." 145 | }, 146 | "Helper-array-sort.sublime-snippet": { 147 | "prefix": "Helper::array_sort", 148 | "body": [ 149 | "array_values(array_sort(${1:\\$array}, function (${2:\\$key}, ${3:\\$value}) {", 150 | " return ${3:\\$value}['${4:name}'];", 151 | "}));" 152 | ], 153 | "description": "Sort the array using the given callback." 154 | }, 155 | "Helper-array-where.sublime-snippet": { 156 | "prefix": "Helper::array_where", 157 | "body": [ 158 | "array_where(${2:\\$array}, function (${3:\\$key}, ${4:\\$value}) {", 159 | " return ${4:is_string(\\$value);}", 160 | "});" 161 | ], 162 | "description": "Filter the array using the given callback." 163 | }, 164 | "Helper-misc-class_uses-recursive.sublime-snippet": { 165 | "prefix": "Helper::misc-class_uses_recursive", 166 | "body": [ 167 | "class_uses_recursive(${1:'Foo\\Bar\\Baz'})" 168 | ], 169 | "description": "Returns all traits used by a class, its subclasses and trait of their traits." 170 | }, 171 | "Helper-misc-collect.sublime-snippet": { 172 | "prefix": "Helper::misc-collect", 173 | "body": [ 174 | "collect(${1:'Foo\\Bar\\Baz'})" 175 | ], 176 | "description": "Create a collection from the given value." 177 | }, 178 | "Helper-misc-csrf_field.sublime-snippet": { 179 | "prefix": "Helper::misc-csrf_field", 180 | "body": [ 181 | "csrf_field()" 182 | ], 183 | "description": "Get the value of the current CSRF token." 184 | }, 185 | "Helper-misc-csrf_token.sublime-snippet": { 186 | "prefix": "Helper::misc-csrf_token", 187 | "body": [ 188 | "csrf_token()" 189 | ], 190 | "description": "Get the value of the current CSRF token." 191 | }, 192 | "Helper-misc-dd.sublime-snippet": { 193 | "prefix": "Helper::misc-dd", 194 | "body": [ 195 | "dd(${1:\\$value});" 196 | ], 197 | "description": "Dump the passed variables and end the script." 198 | }, 199 | "Helper-misc-object_get.sublime-snippet": { 200 | "prefix": "Helper::misc-object_get", 201 | "body": [ 202 | "object_get(${1:\\$object, ${2:'names.john'}, ${3:'default'})" 203 | ], 204 | "description": "Get an item from an object using \"dot\" notation." 205 | }, 206 | "Helper-misc-trait_uses-recursive.sublime-snippet": { 207 | "prefix": "Helper::misc-trait_uses_recursive", 208 | "body": [ 209 | "trait_uses_recursive(${1:'Foo\\Bar\\Baz'})" 210 | ], 211 | "description": "Returns all traits used by a trait and its traits." 212 | }, 213 | "Helper-path-app.sublime-snippet": { 214 | "prefix": "Helper::path-app", 215 | "body": [ 216 | "app_path()" 217 | ], 218 | "description": "Get the fully qualified path to the app directory." 219 | }, 220 | "Helper-path-base.sublime-snippet": { 221 | "prefix": "Helper::path-base", 222 | "body": [ 223 | "base_path(${1:'file'})" 224 | ], 225 | "description": "Get the fully qualified path to the root of the application install." 226 | }, 227 | "Helper-path-config.sublime-snippet": { 228 | "prefix": "Helper::path-config", 229 | "body": [ 230 | "config_path()" 231 | ], 232 | "description": "Get the fully qualified path to the app directory." 233 | }, 234 | "Helper-path-elixir.sublime-snippet": { 235 | "prefix": "Helper::path-elixir", 236 | "body": [ 237 | "elixir('${1:file}')" 238 | ], 239 | "description": "Get the path to the versionned Elixir file." 240 | }, 241 | "Helper-path-public.sublime-snippet": { 242 | "prefix": "Helper::path-public", 243 | "body": [ 244 | "public_path()" 245 | ], 246 | "description": "Get the fully qualified path to the public directory." 247 | }, 248 | "Helper-path-storage.sublime-snippet": { 249 | "prefix": "Helper::path-storage", 250 | "body": [ 251 | "storage_path(${1:'file'})" 252 | ], 253 | "description": "Get the fully qualified path to the app/storage directory." 254 | }, 255 | "Helper-strings-camel_case.sublime-snippet": { 256 | "prefix": "Helper::strings-camel_case", 257 | "body": [ 258 | "camel_case(${1:'foo_bar'})" 259 | ], 260 | "description": "Convert a value to camel case." 261 | }, 262 | "Helper-strings-class_basename.sublime-snippet": { 263 | "prefix": "Helper::strings-class_basename", 264 | "body": [ 265 | "class_basename(${1:'Foo\\Bar\\Baz'})$2" 266 | ], 267 | "description": "Get the class \"basename\" of the given object / class." 268 | }, 269 | "Helper-strings-e.sublime-snippet": { 270 | "prefix": "Helper::strings-e", 271 | "body": [ 272 | "e(${1:'foo'})" 273 | ], 274 | "description": "Escape HTML entities in a string." 275 | }, 276 | "Helper-strings-ends_with.sublime-snippet": { 277 | "prefix": "Helper::strings-ends_with", 278 | "body": [ 279 | "ends_with(${1:'haystack'}, ${2:'needles'})" 280 | ], 281 | "description": "Determine if a given string ends with a given substring." 282 | }, 283 | "Helper-strings-snake_case.sublime-snippet": { 284 | "prefix": "Helper::strings-snake_case", 285 | "body": [ 286 | "snake_case(${1:'fooBar'})" 287 | ], 288 | "description": "Convert the given string to snake_case." 289 | }, 290 | "Helper-strings-starts_with.sublime-snippet": { 291 | "prefix": "Helper::strings-starts_with", 292 | "body": [ 293 | "starts_with(${1:'haystack'}, ${2:'needle'})" 294 | ], 295 | "description": "Determine if the given haystack begins with the given needle." 296 | }, 297 | "Helper-strings-str_contains.sublime-snippet": { 298 | "prefix": "Helper::strings-str_contains", 299 | "body": [ 300 | "str_contains(${1:'This is my name'}, ${2:'my'})" 301 | ], 302 | "description": "Determine if the given haystack contains the given needle." 303 | }, 304 | "Helper-strings-str_finish.sublime-snippet": { 305 | "prefix": "Helper::strings-str_finish", 306 | "body": [ 307 | "str_finish(${1:'this/string'}, ${2:'/'})" 308 | ], 309 | "description": "Determine if a given string matches a given pattern. Asterisks may be used to indicate wildcards." 310 | }, 311 | "Helper-strings-str_is.sublime-snippet": { 312 | "prefix": "Helper::strings-str_is", 313 | "body": [ 314 | "str_is(${1:'foo*'}, ${2:'foobar'})" 315 | ], 316 | "description": "Add a single instance of the given needle to the haystack. Remove any extra instances." 317 | }, 318 | "Helper-strings-str_limit.sublime-snippet": { 319 | "prefix": "Helper::strings-str_limit", 320 | "body": [ 321 | "str_limit(${1:\\$value}, ${2:100})" 322 | ], 323 | "description": "Limit the number of characters in a string." 324 | }, 325 | "Helper-strings-str_random.sublime-snippet": { 326 | "prefix": "Helper::strings-str_random", 327 | "body": [ 328 | "str_random(${1:40})" 329 | ], 330 | "description": "Generate a random string of the given length." 331 | }, 332 | "Helper-strings-str_singular.sublime-snippet": { 333 | "prefix": "Helper::strings-str_singular", 334 | "body": [ 335 | "str_singular(${1:'string'})" 336 | ], 337 | "description": "Convert a string to its singular form (English only)." 338 | }, 339 | "Helper-strings-str_slug.sublime-snippet": { 340 | "prefix": "Helper::strings-str_slug", 341 | "body": [ 342 | "str_slug(${1:'fooBar'})" 343 | ], 344 | "description": "Generate a URL friendly \"slug\" from a given string." 345 | }, 346 | "Helper-strings-studly_case.sublime-snippet": { 347 | "prefix": "Helper::strings-studly_case", 348 | "body": [ 349 | "studly_case(${1:'foo_bar'})" 350 | ], 351 | "description": "Convert the given string to StudlyCase." 352 | }, 353 | "Helper-strings-title_case.sublime-snippet": { 354 | "prefix": "Helper::strings-title_case", 355 | "body": [ 356 | "title_case(${1:'fooBar'})" 357 | ], 358 | "description": "Convert a value to title case." 359 | }, 360 | "Helper-strings-trans.sublime-snippet": { 361 | "prefix": "Helper::strings-trans", 362 | "body": [ 363 | "trans(${1:'validation.required'})" 364 | ], 365 | "description": "Translate a given language line. Alias of Lang::get." 366 | }, 367 | "Helper-strings-trans_choice.sublime-snippet": { 368 | "prefix": "Helper::strings-trans_choice", 369 | "body": [ 370 | "trans_choice(${1:'foo.bar'}, ${2:\\$count})" 371 | ], 372 | "description": "Translate a given language line with inflection. Alias of Lang::choice." 373 | }, 374 | "Helper-strings_plural.sublime-snippet": { 375 | "prefix": "Helper::strings-str_plural", 376 | "body": [ 377 | "str_plural(${1:'string'})" 378 | ], 379 | "description": "Convert a string to its plural form (English only)." 380 | }, 381 | "Helper-url-action.sublime-snippet": { 382 | "prefix": "Helper::url-action", 383 | "body": [ 384 | "action(${1:'HomeController@getIndex'}, ${2:\\$params})" 385 | ], 386 | "description": "Generate a URL for a given controller action." 387 | }, 388 | "Helper-url-asset.sublime-snippet": { 389 | "prefix": "Helper::url-asset", 390 | "body": [ 391 | "asset(${1:'img/photo.jpg'})" 392 | ], 393 | "description": "Generate a URL for an asset." 394 | }, 395 | "Helper-url-route.sublime-snippet": { 396 | "prefix": "Helper::url-route", 397 | "body": [ 398 | "route(${1:'routeName'}, ${2:\\$params})" 399 | ], 400 | "description": "Generate a URL for a given named route." 401 | }, 402 | "Helper-url-secure_asset.sublime-snippet": { 403 | "prefix": "Helper::url-secure_asset", 404 | "body": [ 405 | "secure_asset(${1:'foo/bar'}, ${2:\\$title}, ${3:\\$attributes})" 406 | ], 407 | "description": "Generate a HTML link to the given asset using HTTPS." 408 | }, 409 | "Helper-url-secure_url.sublime-snippet": { 410 | "prefix": "Helper::secure_url", 411 | "body": [ 412 | "secure_url(${1:'foo/bar'}, ${2:\\$parameters})" 413 | ], 414 | "description": "Generate a fully qualified URL to a given path using HTTPS." 415 | }, 416 | "Helper-url.sublime-snippet": { 417 | "prefix": "Helper::url-url", 418 | "body": [ 419 | "url(${1:'foo/bar'}, ${2:\\$parameters}, ${3:\\$secure})" 420 | ], 421 | "description": "Generate a fully qualified URL to the given path." 422 | } 423 | } 424 | -------------------------------------------------------------------------------- /snippets/log.json: -------------------------------------------------------------------------------- 1 | { 2 | "Log-alert.sublime-snippet": { 3 | "prefix": "Log::alert", 4 | "body": [ 5 | "Log::alert(\"${1:message}\");" 6 | ], 7 | "description": "Log an alert message to the logs." 8 | }, 9 | "Log-critical.sublime-snippet": { 10 | "prefix": "Log::critical", 11 | "body": [ 12 | "Log::critical(\"${1:message}\");" 13 | ], 14 | "description": "Log a critical message to the logs." 15 | }, 16 | "Log-debug.sublime-snippet": { 17 | "prefix": "Log::debug", 18 | "body": [ 19 | "Log::debug(\"${1:message}\");" 20 | ], 21 | "description": "Log a debug message to the logs." 22 | }, 23 | "Log-emergency.sublime-snippet": { 24 | "prefix": "Log::emergency", 25 | "body": [ 26 | "Log::emergency(\"${1:message}\");" 27 | ], 28 | "description": "Log an emergency message to the logs." 29 | }, 30 | "Log-error.sublime-snippet": { 31 | "prefix": "Log::error", 32 | "body": [ 33 | "Log::error(\"${1:message}\");" 34 | ], 35 | "description": "Log an error message to the logs." 36 | }, 37 | "Log-info.sublime-snippet": { 38 | "prefix": "Log::info", 39 | "body": [ 40 | "Log::info(\"${1:message}\");" 41 | ], 42 | "description": "Log an informational message to the logs." 43 | }, 44 | "Log-log.sublime-snippet": { 45 | "prefix": "Log::log", 46 | "body": [ 47 | "Log::log(\"${1:level}\", \"${2:message}\");" 48 | ], 49 | "description": "Log a message to the logs." 50 | }, 51 | "Log-notice.sublime-snippet": { 52 | "prefix": "Log::notice", 53 | "body": [ 54 | "Log::notice(\"${1:message}\");" 55 | ], 56 | "description": "Log a notice to the logs." 57 | }, 58 | "Log-useDailyFiles.sublime-snippet": { 59 | "prefix": "Log::useDailyFiles", 60 | "body": [ 61 | "Log::useDailyFiles('${1:path}', ${2:days}, '${3:level}');" 62 | ], 63 | "description": "Register a daily file log handler." 64 | }, 65 | "Log-useFiles.sublime-snippet": { 66 | "prefix": "Log::useFiles", 67 | "body": [ 68 | "Log::useFiles('${1:path}', '${2:level}');" 69 | ], 70 | "description": "Register a file log handler." 71 | }, 72 | "Log-warning.sublime-snippet": { 73 | "prefix": "Log::warning", 74 | "body": [ 75 | "Log::warning(\"${1:message}\");" 76 | ], 77 | "description": "Log a warning message to the logs." 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /snippets/mail.json: -------------------------------------------------------------------------------- 1 | { 2 | "Mail-later.sublime-snippet": { 3 | "prefix": "Mail::later", 4 | "body": [ 5 | "Mail::later(${1:5}, '${2:Html.view}', ${3:\\$data}, function (${4:\\$message}) {", 6 | " ${4}->from(${5:'john@johndoe.com'}, ${6:'John Doe'});", 7 | " ${4}->sender(${7:'john@johndoe.com'}, ${8:'John Doe'});", 8 | " ${4}->to(${9:'john@johndoe.com'}, ${10:'John Doe'});", 9 | " ${4}->cc(${11:'john@johndoe.com'}, ${12:'John Doe'});", 10 | " ${4}->bcc(${13:'john@johndoe.com'}, ${14:'John Doe'});", 11 | " ${4}->replyTo(${15:'john@johndoe.com'}, ${16:'John Doe'});", 12 | " ${4}->subject(${17:'Subject'});", 13 | " ${4}->priority(${18:3});", 14 | " ${4}->attach(${19:'pathToFile'});", 15 | "});$20" 16 | ], 17 | "description": "Queue a new e-mail message for sending after (n) seconds." 18 | }, 19 | "Mail-laterOn.sublime-snippet": { 20 | "prefix": "Mail::laterOn", 21 | "body": [ 22 | "Mail::queueOn(${1:'queue-name'}, ${2:5}, '${3:Html.view}', ${4:\\$data}, function (${5:\\$message}) {", 23 | " ${5}->from(${6:'john@johndoe.com'}, ${7:'John Doe'});", 24 | " ${5}->sender(${8:'john@johndoe.com'}, ${9:'John Doe'});", 25 | " ${5}->to(${10:'john@johndoe.com'}, ${11:'John Doe'});", 26 | " ${5}->cc(${12:'john@johndoe.com'}, ${13:'John Doe'});", 27 | " ${5}->bcc(${14:'john@johndoe.com'}, ${15:'John Doe'});", 28 | " ${5}->replyTo(${16:'john@johndoe.com'}, ${17:'John Doe'});", 29 | " ${5}->subject(${18:'Subject'});", 30 | " ${5}->priority(${19:3});", 31 | " ${5}->attach(${20:'pathToFile'});", 32 | "});$21" 33 | ], 34 | "description": "Queue a new e-mail message for sending after (n) seconds on the given queue." 35 | }, 36 | "Mail-plain.sublime-snippet": { 37 | "prefix": "Mail::plain", 38 | "body": [ 39 | "Mail::plain('${1:plainText.view}', ${2:\\$data}, function (${3:\\$message}) {", 40 | " ${3}->from(${4:'john@johndoe.com'}, ${5:'John Doe'});", 41 | " ${3}->sender(${6:'john@johndoe.com'}, ${7:'John Doe'});", 42 | " ${3}->to(${8:'john@johndoe.com'}, ${9:'John Doe'});", 43 | " ${3}->cc(${10:'john@johndoe.com'}, ${11:'John Doe'});", 44 | " ${3}->bcc(${12:'john@johndoe.com'}, ${13:'John Doe'});", 45 | " ${3}->replyTo(${14:'john@johndoe.com'}, ${15:'John Doe'});", 46 | " ${3}->subject(${16:'Subject'});", 47 | " ${3}->priority(${17:3});", 48 | " ${3}->attach(${18:'pathToFile'});", 49 | "});$19" 50 | ], 51 | "description": "Send a new message when only a plain part." 52 | }, 53 | "Mail-queue.sublime-snippet": { 54 | "prefix": "Mail::queue", 55 | "body": [ 56 | "Mail::queue('${1:Html.view}', ${2:\\$data}, function (${3:\\$message}) {", 57 | " ${3}->from(${4:'john@johndoe.com'}, ${5:'John Doe'});", 58 | " ${3}->sender(${6:'john@johndoe.com'}, ${7:'John Doe'});", 59 | " ${3}->to(${8:'john@johndoe.com'}, ${9:'John Doe'});", 60 | " ${3}->cc(${10:'john@johndoe.com'}, ${11:'John Doe'});", 61 | " ${3}->bcc(${12:'john@johndoe.com'}, ${13:'John Doe'});", 62 | " ${3}->replyTo(${14:'john@johndoe.com'}, ${15:'John Doe'});", 63 | " ${3}->subject(${16:'Subject'});", 64 | " ${3}->priority(${17:3});", 65 | " ${3}->attach(${18:'pathToFile'});", 66 | "});$19" 67 | ], 68 | "description": "Queue a new e-mail message for sending." 69 | }, 70 | "Mail-queueOn.sublime-snippet": { 71 | "prefix": "Mail::queueOn", 72 | "body": [ 73 | "Mail::queueOn(${1:'queue-name'}, '${2:Html.view}', ${3:\\$data}, function (${4:\\$message}) {", 74 | " ${4}->from(${5:'john@johndoe.com'}, ${6:'John Doe'});", 75 | " ${4}->sender(${7:'john@johndoe.com'}, ${8:'John Doe'});", 76 | " ${4}->to(${9:'john@johndoe.com'}, ${10:'John Doe'});", 77 | " ${4}->cc(${11:'john@johndoe.com'}, ${12:'John Doe'});", 78 | " ${4}->bcc(${13:'john@johndoe.com'}, ${14:'John Doe'});", 79 | " ${4}->replyTo(${15:'john@johndoe.com'}, ${16:'John Doe'});", 80 | " ${4}->subject(${17:'Subject'});", 81 | " ${4}->priority(${18:3});", 82 | " ${4}->attach(${19:'pathToFile'});", 83 | "});$20" 84 | ], 85 | "description": "Queue a new e-mail message for sending on the given queue." 86 | }, 87 | "Mail-raw.sublime-snippet": { 88 | "prefix": "Mail::raw", 89 | "body": [ 90 | "Mail::raw('${1:plain text message}', function (${2:\\$message}) {", 91 | " ${2}->from(${3:'john@johndoe.com'}, ${4:'John Doe'});", 92 | " ${2}->sender(${5:'john@johndoe.com'}, ${6:'John Doe'});", 93 | " ${2}->to(${7:'john@johndoe.com'}, ${8:'John Doe'});", 94 | " ${2}->cc(${9:'john@johndoe.com'}, ${10:'John Doe'});", 95 | " ${2}->bcc(${11:'john@johndoe.com'}, ${12:'John Doe'});", 96 | " ${2}->replyTo(${13:'john@johndoe.com'}, ${14:'John Doe'});", 97 | " ${2}->subject(${15:'Subject'});", 98 | " ${2}->priority(${16:3});", 99 | " ${2}->attach(${17:'pathToFile'});", 100 | "});$18" 101 | ], 102 | "description": "Send a new message when only a raw text part." 103 | }, 104 | "Mail-send.sublime-snippet": { 105 | "prefix": "Mail::send", 106 | "body": [ 107 | "Mail::send('${1:Html.view}', ${2:\\$data}, function (${3:\\$message}) {", 108 | " ${3}->from(${4:'john@johndoe.com'}, ${5:'John Doe'});", 109 | " ${3}->sender(${6:'john@johndoe.com'}, ${7:'John Doe'});", 110 | " ${3}->to(${8:'john@johndoe.com'}, ${9:'John Doe'});", 111 | " ${3}->cc(${10:'john@johndoe.com'}, ${11:'John Doe'});", 112 | " ${3}->bcc(${12:'john@johndoe.com'}, ${13:'John Doe'});", 113 | " ${3}->replyTo(${14:'john@johndoe.com'}, ${15:'John Doe'});", 114 | " ${3}->subject(${16:'Subject'});", 115 | " ${3}->priority(${17:3});", 116 | " ${3}->attach(${18:'pathToFile'});", 117 | "});$19" 118 | ], 119 | "description": "Send a new message using a view." 120 | }, 121 | 122 | // 5.3 123 | 124 | "Mail-to": { 125 | "prefix": "Mail::to", 126 | "body": [ 127 | "Mail::to(${1:\\$request->user()})->send(new ${2:MailableClass});$3" 128 | ], 129 | "description": "Mail with Mailable - mailer will automatically use collection 'email' and 'name' properties" 130 | }, 131 | "Mail-to-more": { 132 | "prefix": "Mail::to-more", 133 | "body": [ 134 | "Mail::to(${1:\\$request->user()})", 135 | " ->cc(${2:\\$moreUsers})", 136 | " ->bcc(${3:\\$evenMoreUsers})", 137 | " ->send(new ${4:MailableClass});$5" 138 | ], 139 | "description": "Mail with Mailable - mail to more recipients" 140 | }, 141 | "Mail-queue-mailable": { 142 | "prefix": "Mail::queue-mailable", 143 | "body": [ 144 | "Mail::to(${1:\\$request->user()})", 145 | " ->cc(${2:\\$moreUsers})", 146 | " ->bcc(${3:\\$evenMoreUsers})", 147 | " ->queue(new ${4:MailableClass});$5" 148 | ], 149 | "description": "Mail with Mailable - Queueing A Mail Message" 150 | }, 151 | "Mail-later-mailable": { 152 | "prefix": "Mail::later-mailable", 153 | "body": [ 154 | "Mail::to(${1:\\$request->user()})", 155 | " ->cc(${2:\\$moreUsers})", 156 | " ->bcc(${3:\\$evenMoreUsers})", 157 | " ->later(${4:\\$when}, new ${5:MailableClass});$6" 158 | ], 159 | "description": "Mail with Mailable - Delayed Message Queueing" 160 | }, 161 | 162 | // Mailable 163 | 164 | "Mailable-build-config": { 165 | "prefix": "Mailable::build-config", 166 | "body": [ 167 | "return $this->from('${1:example@example.com}')", 168 | " ->${2:view}('${3:mails.viewName}')", 169 | " ->with([", 170 | " ${4:'orderName' => $this->order->name,}", 171 | " ]);$5" 172 | ], 173 | "description": "Mailable - Configuring Mailable build()" 174 | } 175 | } -------------------------------------------------------------------------------- /snippets/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "Laravel Model: Database Connection": { 3 | "prefix": "Model::con", 4 | "body": [ 5 | "/**", 6 | " * The connection name for the model.", 7 | " *", 8 | " * @var string|null", 9 | " */", 10 | "protected \\$connection = '$0';" 11 | ], 12 | "description": "Database Connection: The connection name for the model." 13 | }, 14 | "Laravel Model: Table": { 15 | "prefix": "Model::t", 16 | "body": [ 17 | "/**", 18 | " * The table associated with the model.", 19 | " *", 20 | " * @var string", 21 | " */", 22 | "protected \\$table = '$0';" 23 | ], 24 | "description": "Protected Table: The table associated with the model." 25 | }, 26 | "Laravel Model: Primary Key": { 27 | "prefix": "Model::pk", 28 | "body": [ 29 | "/**", 30 | " * The primary key for the model.", 31 | " *", 32 | " * @var string", 33 | " */", 34 | "protected \\$primaryKey = '${1:id}';" 35 | ], 36 | "description": "Primary Key: The primary key for the model." 37 | }, 38 | "Laravel Model: KeyType": { 39 | "prefix": "Model::kt", 40 | "body": [ 41 | "/**", 42 | " * The \"type\" of the primary key ID.", 43 | " *", 44 | " * @var string", 45 | " */", 46 | "protected \\$keyType = '${1:int}';" 47 | ], 48 | "description": "KeyType: The \"type\" of the primary key ID." 49 | }, 50 | "Laravel Model: Incrementing": { 51 | "prefix": "Model::i", 52 | "body": [ 53 | "/**", 54 | " * Indicates if the IDs are auto-incrementing.", 55 | " *", 56 | " * @var bool", 57 | " */", 58 | "public \\$incrementing = ${1:true};" 59 | ], 60 | "description": "Incrementing: Indicates if the IDs are auto-incrementing." 61 | }, 62 | "Laravel Model: Timestamps": { 63 | "prefix": "Model::ts", 64 | "body": [ 65 | "/**", 66 | " * Indicates if the model should be timestamped.", 67 | " *", 68 | " * @var bool", 69 | " */", 70 | "public \\$timestamps = ${1:true};" 71 | ], 72 | "description": "Timestamps: Indicates if the model should be timestamped." 73 | }, 74 | "Laravel Model: Date Format": { 75 | "prefix": "Model::df", 76 | "body": [ 77 | "/**", 78 | " * The storage format of the model's date columns.", 79 | " *", 80 | " * @var string", 81 | " */", 82 | "protected \\$dateFormat = '$0';" 83 | ], 84 | "description": "Date Format: The storage format of the model's date columns." 85 | }, 86 | "Laravel Model: Attribute Casting": { 87 | "prefix": "Model::c", 88 | "body": [ 89 | "/**", 90 | " * The attributes that should be cast.", 91 | " *", 92 | " * @var array", 93 | " */", 94 | "protected \\$casts = [", 95 | "\t'$1' => '${0:type}',", 96 | "];" 97 | ], 98 | "description": "Attribute Casting: The attributes that should be cast." 99 | }, 100 | "Laravel Model: Mass Assignment (Fillable) ": { 101 | "prefix": "Model::f", 102 | "body": [ 103 | "/**", 104 | " * The attributes that are mass assignable.", 105 | " *", 106 | " * @var array", 107 | " */", 108 | "protected \\$fillable = ['$0'];" 109 | ], 110 | "description": "Mass Assignment (Fillable): The attributes that are mass assignable." 111 | }, 112 | "Laravel Model: Guard Attributes": { 113 | "prefix": "Model::g", 114 | "body": [ 115 | "/**", 116 | " * The attributes that aren't mass assignable.", 117 | " *", 118 | " * @var array", 119 | " */", 120 | "protected \\$guarded = ['${1:*}'];" 121 | ], 122 | "description": "Guard Attributes: The attributes that aren't mass assignable." 123 | }, 124 | "Laravel Model: Dates": { 125 | "prefix": "Model::d", 126 | "body": [ 127 | "/**", 128 | " * The attributes that should be mutated to dates.", 129 | " *", 130 | " * @var array", 131 | " */", 132 | "protected \\$dates = ['created_at', 'updated_at', '${0:deleted_at}'];" 133 | ], 134 | "description": "Dates: The attributes that should be mutated to dates." 135 | }, 136 | "Laravel Model: Boot": { 137 | "prefix": "Model::b", 138 | "body": [ 139 | "/**", 140 | " * The \"booting\" method of the model.", 141 | " *", 142 | " * @return void", 143 | " */", 144 | "protected static function boot()", 145 | "{", 146 | "\tparent::boot();", 147 | "\t", 148 | "\t$0", 149 | "}" 150 | ], 151 | "description": "Boot: The \"booting\" method of the model." 152 | }, 153 | "Laravel Model: Local Scope": { 154 | "prefix": "Model::s", 155 | "body": [ 156 | "/**", 157 | " * Scope a query to only include $1", 158 | " *", 159 | " * @param \\Illuminate\\Database\\Eloquent\\Builder \\$query", 160 | " * @return \\Illuminate\\Database\\Eloquent\\Builder", 161 | " */", 162 | "public function scope$2(\\$query)", 163 | "{", 164 | "\treturn \\$query->where('$3'$0);", 165 | "}" 166 | ], 167 | "description": "Local Scope: Query a local scope within your model." 168 | }, 169 | "Laravel Model: Hidden": { 170 | "prefix": "Model::h", 171 | "body": [ 172 | "/**", 173 | " * The attributes that should be hidden for arrays.", 174 | " *", 175 | " * @var array", 176 | " */", 177 | "protected \\$hidden = ['$0'];" 178 | ], 179 | "description": "Hidden: The attributes that should be hidden for arrays." 180 | }, 181 | "Laravel Model: Visible": { 182 | "prefix": "Model::v", 183 | "body": [ 184 | "/**", 185 | " * The attributes that should be visible in arrays.", 186 | " *", 187 | " * @var array", 188 | " */", 189 | "protected \\$visible = ['$0'];" 190 | ], 191 | "description": "Visible: The attributes that should be visible in arrays." 192 | }, 193 | "Laravel Model: Appends": { 194 | "prefix": "Model::ap", 195 | "body": [ 196 | "/**", 197 | " * The accessors to append to the model's array form.", 198 | " *", 199 | " * @var array", 200 | " */", 201 | "protected \\$appends = ['$0'];" 202 | ], 203 | "description": "Appends: The accessors to append to the model's array form." 204 | }, 205 | "Laravel Model: Touches": { 206 | "prefix": "Model::tc", 207 | "body": [ 208 | "/**", 209 | " * The relationships that should be touched on save.", 210 | " *", 211 | " * @var array", 212 | " */", 213 | "protected \\$touches = [$0];" 214 | ], 215 | "description": "Touches: The relationships that should be touched on save." 216 | }, 217 | "Laravel Model: PerPage": { 218 | "prefix": "Model::pp", 219 | "body": [ 220 | "/**", 221 | " * The number of models to return for pagination.", 222 | " *", 223 | " * @var int", 224 | " */", 225 | "protected \\$perPage = $0;" 226 | ], 227 | "description": "PerPage: The number of models to return for pagination." 228 | }, 229 | "Laravel Model: Created At": { 230 | "prefix": "Model::cat", 231 | "body": [ 232 | "/**", 233 | " * The name of the \"created at\" column.", 234 | " *", 235 | " * @var string|null", 236 | " */", 237 | "const CREATED_AT = '${1:created_at}';$0" 238 | ], 239 | "description": "Created At: The name of the \"created at\" column." 240 | }, 241 | "Laravel Model: Updated At": { 242 | "prefix": "Model::uat", 243 | "body": [ 244 | "/**", 245 | " * The name of the \"updated at\" column.", 246 | " *", 247 | " * @var string|null", 248 | " */", 249 | "const UPDATED_AT = '${1:updated_at}';$0" 250 | ], 251 | "description": "Updated At: The name of the \"updated at\" column." 252 | }, 253 | "Laravel Model: Deleted At": { 254 | "prefix": "Model::dat", 255 | "body": [ 256 | "/**", 257 | " * The name of the \"deleted at\" column.", 258 | " *", 259 | " * @var string", 260 | " */", 261 | "const DELETED_AT = '${1:deleted_at}';$0" 262 | ], 263 | "description": "Deleted At: The name of the \"deleted at\" column." 264 | }, 265 | "Laravel Model: Dispatches Events": { 266 | "prefix": "Model::de", 267 | "body": [ 268 | "/**", 269 | " * The event map for the model.", 270 | " *", 271 | " * @var array", 272 | " */", 273 | "protected \\$dispatchesEvents = [", 274 | "\t'$1' => $2,", 275 | "];" 276 | ], 277 | "description": "Dispatches Events: The event map for the model." 278 | }, 279 | "Laravel Model: Accessor": { 280 | "prefix": "Model::ac", 281 | "body": [ 282 | "/**", 283 | " * Get the $1", 284 | " *", 285 | " * @param string \\$value", 286 | " * @return ${4:string}", 287 | " */", 288 | "public function get$2Attribute(\\$value)", 289 | "{", 290 | "\treturn ${3:\\$value};", 291 | "}" 292 | ], 293 | "description": "Accessors: Define an accessor for the model." 294 | }, 295 | "Laravel Model: Mutator": { 296 | "prefix": "Model::mu", 297 | "body": [ 298 | "/**", 299 | " * Set the $1", 300 | " *", 301 | " * @param string \\$value", 302 | " * @return ${5:void}", 303 | " */", 304 | "public function set$2Attribute(\\$value)", 305 | "{", 306 | "\treturn \\$this->attributes['$3'] = ${4:\\$value};", 307 | "}" 308 | ], 309 | "description": "Mutators: Define a mutator for the model." 310 | }, 311 | "Laravel Model: Attribute": { 312 | "prefix": "Model::att", 313 | "body": [ 314 | "/**", 315 | " * Interact with the $1 attribute.", 316 | " *", 317 | " * @return \\Illuminate\\Database\\Eloquent\\Casts\\Attribute", 318 | " */", 319 | "public function $1(): Attribute", 320 | "{", 321 | "\treturn Attribute::make(", 322 | "\t\tget: fn ($2 \\$value) => $3,", 323 | "\t\tset: fn ($2 \\$value) => $4,", 324 | "\t);", 325 | "}" 326 | ], 327 | "description": "Attribute: Define a attribute method for the model." 328 | }, 329 | "Laravel Model: Get attribute": { 330 | "prefix": "Model::gatt", 331 | "body": [ 332 | "/**", 333 | " * Interact with the $1 attribute.", 334 | " *", 335 | " * @return \\Illuminate\\Database\\Eloquent\\Casts\\Attribute", 336 | " */", 337 | "public function $1(): Attribute", 338 | "{", 339 | "\treturn Attribute::get(fn ($2 \\$value) => $3);", 340 | "}" 341 | ], 342 | "description": "Attribute: Define a get attribute method for the model." 343 | }, 344 | "Laravel Model: Set attribute": { 345 | "prefix": "Model::satt", 346 | "body": [ 347 | "/**", 348 | " * Interact with the $1 attribute.", 349 | " *", 350 | " * @return \\Illuminate\\Database\\Eloquent\\Casts\\Attribute", 351 | " */", 352 | "public function $1(): Attribute", 353 | "{", 354 | "\treturn Attribute::set(fn ($2 \\$value) => $3);", 355 | "}" 356 | ], 357 | "description": "Attribute: Define a set attribute method for the model." 358 | }, 359 | "Laravel Model: Prevents lazy loading": { 360 | "prefix": "Model::pll", 361 | "body": [ 362 | "/**", 363 | " * Indicates whether lazy loading will be prevented on this model..", 364 | " *", 365 | " * @var bool", 366 | " */", 367 | "protected \\$preventsLazyLoading = $0;" 368 | ], 369 | "description": "Prevents lazy loading: Indicates whether lazy loading will be prevented on this model.." 370 | } 371 | } 372 | -------------------------------------------------------------------------------- /snippets/passport.json: -------------------------------------------------------------------------------- 1 | { 2 | "Passport-routes": { 3 | "prefix": "Passport::routes", 4 | "body": [ 5 | "Passport::routes();" 6 | ], 7 | "description": "Passport - routes" 8 | }, 9 | "Passport-tokensExpireIn": { 10 | "prefix": "Passport::tokensExpireIn", 11 | "body": [ 12 | "Passport::tokensExpireIn(Carbon::now()->addDays(${1:15}));$2" 13 | ], 14 | "description": "Passport - tokensExpireIn" 15 | }, 16 | "Passport-refreshTokensExpireIn": { 17 | "prefix": "Passport::refreshTokensExpireIn", 18 | "body": [ 19 | "Passport::refreshTokensExpireIn(Carbon::now()->addDays(${1:30}));$2" 20 | ], 21 | "description": "Passport - refreshTokensExpireIn" 22 | }, 23 | "Passport-pruneRevokedTokens": { 24 | "prefix": "Passport::pruneRevokedTokens", 25 | "body": [ 26 | "Passport::pruneRevokedTokens();" 27 | ], 28 | "description": "Passport - pruneRevokedTokens" 29 | } 30 | } -------------------------------------------------------------------------------- /snippets/redirect.json: -------------------------------------------------------------------------------- 1 | { 2 | "Redirect-action.sublime-snippet": { 3 | "prefix": "Redirect::action", 4 | "body": [ 5 | "return redirect()->action('${App\\Http\\Controllers\\HomeController@index}', ${2:['parameterKey' => 'value']});$3" 6 | ], 7 | "description": "Redirect to a controller action, with parameters" 8 | }, 9 | "Redirect-back.sublime-snippet": { 10 | "prefix": "Redirect::back", 11 | "body": [ 12 | "return redirect()->back()${1:->withErrors(\\$validator)}${2:->withInput()};$3" 13 | ], 14 | "description": "Redirect to URL, Route or Controller" 15 | }, 16 | "Redirect-namedRoute.sublime-snippet": { 17 | "prefix": "Redirect::namedRoute", 18 | "body": [ 19 | "return redirect()->route('${named_route}', ${2:['parameterKey' => 'value']});$3" 20 | ], 21 | "description": "Redirect to a named route, with parameters" 22 | }, 23 | "Redirect-to.sublime-snippet": { 24 | "prefix": "Redirect::to", 25 | "body": [ 26 | "return redirect('${1:some/url}');$2" 27 | ], 28 | "description": "Redirect to URL, Route or Controller" 29 | }, 30 | "Redirect-withErrors.sublime-snippet": { 31 | "prefix": "Redirect::withErrors", 32 | "body": [ 33 | "->withErrors(${1:\\$validator})$2" 34 | ], 35 | "description": "Redirect to URL, Route or Controller with Errors" 36 | }, 37 | "Redirect-withFlashData.sublime-snippet": { 38 | "prefix": "Redirect::withFlashData", 39 | "body": [ 40 | "->with('${1:flashKey}', '${2:flashValue}')$3" 41 | ], 42 | "description": "Redirect to URL, Route or Controller with Flash Data" 43 | }, 44 | "Redirect-withInput.sublime-snippet": { 45 | "prefix": "Redirect::withInput", 46 | "body": [ 47 | "->withInput(${1:[1, 2])})$2" 48 | ], 49 | "description": "Redirect to URL, Route or Controller with Input" 50 | }, 51 | "Redirect-withInputAndErrors.sublime-snippet": { 52 | "prefix": "Redirect::withInputAndErrors", 53 | "body": [ 54 | "->withInput(${1:\\$request->except('key')})", 55 | "->withErrors(${2:\\$validator})$3" 56 | ], 57 | "description": "Redirect with Inputs and Errors" 58 | }, 59 | "Redirect-withNamedInput.sublime-snippet": { 60 | "prefix": "Redirect::withNamedInput", 61 | "body": [ 62 | "->withInput(${1:['key' => 'value'])})$2" 63 | ], 64 | "description": "Redirect to URL, Route or Controller with Input" 65 | } 66 | } -------------------------------------------------------------------------------- /snippets/relation.json: -------------------------------------------------------------------------------- 1 | { 2 | "Relation-belongsTo.sublime-snippet": { 3 | "prefix": "Relation::belongsTo", 4 | "body": [ 5 | "/**", 6 | " * Get the ${1:user} that owns the ${TM_FILENAME_BASE}", 7 | " *", 8 | " * @return \\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo", 9 | " */", 10 | "public function ${1:user}(): BelongsTo", 11 | "{", 12 | " return \\$this->belongsTo(${2:User}::class${3:, '${4:foreign_key}'}${5:, '${6:other_key}'});", 13 | "}$7" 14 | ], 15 | "description": "A one-to-one inverse relationship." 16 | }, 17 | "Relation-belongsToMany.sublime-snippet": { 18 | "prefix": "Relation::belongsToMany", 19 | "body": [ 20 | "/**", 21 | " * The ${1:roles} that belong to the ${TM_FILENAME_BASE}", 22 | " *", 23 | " * @return \\Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany", 24 | " */", 25 | "public function ${1:roles}(): BelongsToMany", 26 | "{", 27 | " return \\$this->belongsToMany(${2:Role}::class${3:, '${4:role_user_table}'}${5:, '${6:user_id}'}${7:, '${8:role_id}'});", 28 | "}$9" 29 | ], 30 | "description": "A many-to-many relationship." 31 | }, 32 | "Relation-hasMany.sublime-snippet": { 33 | "prefix": "Relation::hasMany", 34 | "body": [ 35 | "/**", 36 | " * Get all of the ${1:comments} for the ${TM_FILENAME_BASE}", 37 | " *", 38 | " * @return \\Illuminate\\Database\\Eloquent\\Relations\\HasMany", 39 | " */", 40 | "public function ${1:comments}(): HasMany", 41 | "{", 42 | " return \\$this->hasMany(${2:Comment}::class${3:, '${4:foreign_key}'}${5:, '${6:local_key}'});", 43 | "}$7" 44 | ], 45 | "description": "A one-to-many relationship." 46 | }, 47 | "Relation-hasManyThrough.sublime-snippet": { 48 | "prefix": "Relation::hasManyThrough", 49 | "body": [ 50 | "/**", 51 | " * Get all of the ${1:comments} for the ${TM_FILENAME_BASE}", 52 | " *", 53 | " * @return \\Illuminate\\Database\\Eloquent\\Relations\\HasManyThrough", 54 | " */", 55 | "public function ${1:comments}(): HasManyThrough", 56 | "{", 57 | " return \\$this->hasManyThrough(${2:Comment}::class, ${3:Post}::class);", 58 | "}$4" 59 | ], 60 | "description": "A Has Many Through relationship." 61 | }, 62 | "Relation-hasOne.sublime-snippet": { 63 | "prefix": "Relation::hasOne", 64 | "body": [ 65 | "/**", 66 | " * Get the ${1:user} associated with the ${TM_FILENAME_BASE}", 67 | " *", 68 | " * @return \\Illuminate\\Database\\Eloquent\\Relations\\HasOne", 69 | " */", 70 | "public function ${1:user}(): HasOne", 71 | "{", 72 | " return \\$this->hasOne(${2:User}::class${3:, '${4:foreign_key}'}${5:, '${6:local_key}'});", 73 | "}$7" 74 | ], 75 | "description": "A one-to-one relationship." 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /snippets/request.json: -------------------------------------------------------------------------------- 1 | { 2 | "Request-method.sublime-snippet": { 3 | "prefix": "Request::method", 4 | "body": [ 5 | "\\$request->method()" 6 | ], 7 | "description": "Get the request method (GET, POST, ...)." 8 | }, 9 | "Request-root.sublime-snippet": { 10 | "prefix": "Request::root", 11 | "body": [ 12 | "\\$request->root()" 13 | ], 14 | "description": "Get the root URL for the application." 15 | }, 16 | "Request-url.sublime-snippet": { 17 | "prefix": "Request::url", 18 | "body": [ 19 | "\\$request->url()" 20 | ], 21 | "description": "Get the URL (no query string) for the request." 22 | }, 23 | "Request-fullUrl.sublime-snippet": { 24 | "prefix": "Request::fullUrl", 25 | "body": [ 26 | "\\$request->fullUrl()" 27 | ], 28 | "description": "Get the full URL for the request." 29 | }, 30 | "Request-fullUrlWithQuery": { 31 | "prefix": "Request::fullUrlWithQuery", 32 | "body": [ 33 | "\\$request->fullUrlWithQuery(${1:\\$query})$2" 34 | ], 35 | "description": "Get the full URL for the request with the added query string parameters." 36 | }, 37 | "Request-path.sublime-snippet": { 38 | "prefix": "Request::path", 39 | "body": [ 40 | "\\$request->path()" 41 | ], 42 | "description": "Get the current path info for the request." 43 | }, 44 | "Request-decodedPath.sublime-snippet": { 45 | "prefix": "Request::decodedPath", 46 | "body": [ 47 | "\\$request->decodedPath()" 48 | ], 49 | "description": "Get the current encoded path info for the request." 50 | }, 51 | "Request-segment.sublime-snippet": { 52 | "prefix": "Request::segment", 53 | "body": [ 54 | "\\$request->segment(${1:\\$index}, '${2:default}')$3" 55 | ], 56 | "description": "Get a segment from the URI (1 based index)." 57 | }, 58 | "Request-segments.sublime-snippet": { 59 | "prefix": "Request::segments", 60 | "body": [ 61 | "\\$request->segments()" 62 | ], 63 | "description": "Get all of the segments for the request path." 64 | }, 65 | "Request-is": { 66 | "prefix": "Request::is", 67 | "body": [ 68 | "\\$request->is()" 69 | ], 70 | "description": "Determine if the current request URI matches a pattern." 71 | }, 72 | "Request-fullUrlIs": { 73 | "prefix": "Request::fullUrlIs", 74 | "body": [ 75 | "\\$request->fullUrlIs()" 76 | ], 77 | "description": "Determine if the current request URL and query string matches a pattern." 78 | }, 79 | "Request-ajax.sublime-snippet": { 80 | "prefix": "Request::ajax", 81 | "body": [ 82 | "\\$request->ajax()" 83 | ], 84 | "description": "Determine if the request is the result of an AJAX call." 85 | }, 86 | "Request-pjax.sublime-snippet": { 87 | "prefix": "Request::pjax", 88 | "body": [ 89 | "\\$request->pjax()" 90 | ], 91 | "description": "Determine if the request is the result of an PJAX call." 92 | }, 93 | "Request-secure.sublime-snippet": { 94 | "prefix": "Request::secure", 95 | "body": [ 96 | "\\$request->secure()" 97 | ], 98 | "description": "Determine if the request is over HTTPS." 99 | }, 100 | "Request-ip.sublime-snippet": { 101 | "prefix": "Request::ip", 102 | "body": [ 103 | "\\$request->ip()" 104 | ], 105 | "description": "Returns the client IP address." 106 | }, 107 | "Request-ips.sublime-snippet": { 108 | "prefix": "Request::ips", 109 | "body": [ 110 | "\\$request->ips()" 111 | ], 112 | "description": "Returns the client IP addresses." 113 | }, 114 | "Request-exists.sublime-snippet": { 115 | "prefix": "Request::exists", 116 | "body": [ 117 | "\\$request->exists('${1:key}')$2" 118 | ], 119 | "description": "Determine if the request contains a given input item key." 120 | }, 121 | "Request-has.sublime-snippet": { 122 | "prefix": "Request::has", 123 | "body": [ 124 | "\\$request->has('${1:key}')$2" 125 | ], 126 | "description": "Determine if the request contains a non-empty value for an input item." 127 | }, 128 | "Request-all.sublime-snippet": { 129 | "prefix": "Request::all", 130 | "body": [ 131 | "\\$request->all()" 132 | ], 133 | "description": "Get all of the input and files for the request." 134 | }, 135 | "Request-input.sublime-snippet": { 136 | "prefix": "Request::input", 137 | "body": [ 138 | "\\$request->input('${1:key}'${2:, 'default'})$3" 139 | ], 140 | "description": "Retrieve an input item from the request." 141 | }, 142 | "Request-only.sublime-snippet": { 143 | "prefix": "Request::only", 144 | "body": [ 145 | "\\$request->only(${1:\\$keys})$2" 146 | ], 147 | "description": "Get a subset of the items from the input data." 148 | }, 149 | "Request-except.sublime-snippet": { 150 | "prefix": "Request::except", 151 | "body": [ 152 | "\\$request->except(${1:\\$keys})$2" 153 | ], 154 | "description": "Get all of the input except for a specified array of items." 155 | }, 156 | "Request-intersect": { 157 | "prefix": "Request::intersect", 158 | "body": [ 159 | "\\$request->intersect(${1:\\$keys})$2" 160 | ], 161 | "description": "Intersect an array of items with the input data." 162 | }, 163 | "Request-query.sublime-snippet": { 164 | "prefix": "Request::query", 165 | "body": [ 166 | "\\$request->query('${1:key}', '${2:default'})$3" 167 | ], 168 | "description": "Retrieve a query string item from the request." 169 | }, 170 | "Request-hasCookie": { 171 | "prefix": "Request::hasCookie", 172 | "body": [ 173 | "\\$request->hasCookie('${1:key}')$2" 174 | ], 175 | "description": "Determine if a cookie is set on the request." 176 | }, 177 | "Request-cookie": { 178 | "prefix": "Request::cookie", 179 | "body": [ 180 | "\\$request->cookie('${1:key}', '${2:default'})$3" 181 | ], 182 | "description": "Retrieve a cookie from the request." 183 | }, 184 | "Request-allFiles.sublime-snippet": { 185 | "prefix": "Request::allFiles", 186 | "body": [ 187 | "\\$request->allFiles()" 188 | ], 189 | "description": "Get an array of all of the files on the request." 190 | }, 191 | "Request-file.sublime-snippet": { 192 | "prefix": "Request::file", 193 | "body": [ 194 | "\\$request->file('${1:key}'${2:, 'default'})$2" 195 | ], 196 | "description": "Retrieve a file from the request." 197 | }, 198 | "Request-hasFile.sublime-snippet": { 199 | "prefix": "Request::hasFile", 200 | "body": [ 201 | "\\$request->hasFile('${1:key}')$2" 202 | ], 203 | "description": "Determine if the uploaded data contains a file." 204 | }, 205 | "Request-hasHeader": { 206 | "prefix": "Request::hasHeader", 207 | "body": [ 208 | "\\$request->hasHeader('${1:key}')$2" 209 | ], 210 | "description": "Determine if a header is set on the request." 211 | }, 212 | "Request-header.sublime-snippet": { 213 | "prefix": "Request::header", 214 | "body": [ 215 | "\\$request->header('${1:key}', ${2:\\$default})$3" 216 | ], 217 | "description": "Retrieve a header from the request." 218 | }, 219 | "Request-server": { 220 | "prefix": "Request::server", 221 | "body": [ 222 | "\\$request->server('${1:key}', ${2:\\$default})$3" 223 | ], 224 | "description": "Retrieve a server variable from the request." 225 | }, 226 | "Request-old.sublime-snippet": { 227 | "prefix": "Request::old", 228 | "body": [ 229 | "\\$request->old('${1:key}'${2:, 'default'})$3" 230 | ], 231 | "description": "Retrieve an old input item." 232 | }, 233 | "Input-flash.sublime-snippet": { 234 | "prefix": "Request::flash", 235 | "body": [ 236 | "\\$request->flash();" 237 | ], 238 | "description": "Flash Input to the Session" 239 | }, 240 | "Input-flashOnly.sublime-snippet": { 241 | "prefix": "Request::flashOnly", 242 | "body": [ 243 | "\\$request->flashOnly(${1:\\$keys});$2" 244 | ], 245 | "description": "Flash only some Input to the Session" 246 | }, 247 | "Input-flashExcept.sublime-snippet": { 248 | "prefix": "Request::flashExcept", 249 | "body": [ 250 | "\\$request->flashExcept(${1:\\$keys});$2" 251 | ], 252 | "description": "Flash only some Input to the Session" 253 | }, 254 | "Request-flush": { 255 | "prefix": "Request::flush", 256 | "body": [ 257 | "\\$request->flush();" 258 | ], 259 | "description": "Flush all of the old input from the session." 260 | }, 261 | "Request-merge": { 262 | "prefix": "Request::merge", 263 | "body": [ 264 | "\\$request->merge(${1:\\$input})$2" 265 | ], 266 | "description": "Merge new input into the current request's input array." 267 | }, 268 | "Request-replace": { 269 | "prefix": "Request::replace", 270 | "body": [ 271 | "\\$request->replace(${1:\\$input})$2" 272 | ], 273 | "description": "Replace the input for the current request." 274 | }, 275 | "Request-json.sublime-snippet": { 276 | "prefix": "Request::json", 277 | "body": [ 278 | "\\$request->json()" 279 | ], 280 | "description": "Determine if the request is sending JSON." 281 | }, 282 | "Request-isJson": { 283 | "prefix": "Request::isJson", 284 | "body": [ 285 | "\\$request->isJson()" 286 | ], 287 | "description": "Determine if the request is sending JSON." 288 | }, 289 | "Request-wantsJson": { 290 | "prefix": "Request::wantsJson", 291 | "body": [ 292 | "\\$request->wantsJson()" 293 | ], 294 | "description": "Determine if the current request is asking for JSON in return." 295 | }, 296 | "Request-accepts": { 297 | "prefix": "Request::accepts", 298 | "body": [ 299 | "\\$request->accepts(${1:\\$contentTypes})$2" 300 | ], 301 | "description": "Determines whether the current requests accepts a given content type." 302 | }, 303 | "Request-prefers": { 304 | "prefix": "Request::prefers", 305 | "body": [ 306 | "\\$request->prefers(${1:\\$contentTypes})$2" 307 | ], 308 | "description": "Return the most suitable content type from the given array based on content negotiation." 309 | }, 310 | "Request-acceptsJson": { 311 | "prefix": "Request::acceptsJson", 312 | "body": [ 313 | "\\$request->acceptsJson()" 314 | ], 315 | "description": "Determines whether a request accepts JSON." 316 | }, 317 | "Request-acceptsHtml": { 318 | "prefix": "Request::acceptsHtml", 319 | "body": [ 320 | "\\$request->acceptsHtml()" 321 | ], 322 | "description": "Determines whether a request accepts HTML." 323 | }, 324 | "Request-format": { 325 | "prefix": "Request::format", 326 | "body": [ 327 | "\\$request->format('${1:html}')$2" 328 | ], 329 | "description": "Get the data format expected in the response." 330 | }, 331 | "Request-bearerToken": { 332 | "prefix": "Request::bearerToken", 333 | "body": [ 334 | "\\$request->bearerToken()" 335 | ], 336 | "description": "Get the bearer token from the request headers." 337 | }, 338 | "Request-session.sublime-snippet": { 339 | "prefix": "Request::session", 340 | "body": [ 341 | "\\$request->session()" 342 | ], 343 | "description": "Get the session associated with the request." 344 | }, 345 | "Request-user.sublime-snippet": { 346 | "prefix": "Request::user", 347 | "body": [ 348 | "\\$request->user()" 349 | ], 350 | "description": "Get the user making the request." 351 | }, 352 | "Request-route": { 353 | "prefix": "Request::route", 354 | "body": [ 355 | "\\$request->route(${1:\\$param})" 356 | ], 357 | "description": "Get the route handling the request." 358 | }, 359 | "Request-fingerprint.sublime-snippet": { 360 | "prefix": "Request::fingerprint", 361 | "body": [ 362 | "\\$request->fingerprint()" 363 | ], 364 | "description": "Get a unique fingerprint for the request / route / IP address." 365 | }, 366 | "Request-getUserResolver": { 367 | "prefix": "Request::getUserResolver", 368 | "body": [ 369 | "\\$request->getUserResolver()" 370 | ], 371 | "description": "Get the user resolver callback." 372 | }, 373 | "Request-setUserResolver": { 374 | "prefix": "Request::setUserResolver", 375 | "body": [ 376 | "\\$request->setUserResolver(${1:\\$callback})$2" 377 | ], 378 | "description": "Set the user resolver callback." 379 | }, 380 | 381 | "Request-getRouteResolver": { 382 | "prefix": "Request::getRouteResolver", 383 | "body": [ 384 | "\\$request->getRouteResolver()" 385 | ], 386 | "description": "Get the route resolver callback." 387 | }, 388 | "Request-setRouteResolver": { 389 | "prefix": "Request::setRouteResolver", 390 | "body": [ 391 | "\\$request->setRouteResolver(${1:\\$callback})$2" 392 | ], 393 | "description": "Set the route resolver callback." 394 | }, 395 | "Request-toArray": { 396 | "prefix": "Request::toArray", 397 | "body": [ 398 | "\\$request->toArray()" 399 | ], 400 | "description": "Get all of the input and files for the request." 401 | }, 402 | "Request-offsetExists": { 403 | "prefix": "Request::offsetExists", 404 | "body": [ 405 | "\\$request->offsetExists('${1:offset}')$2" 406 | ], 407 | "description": "Determine if the given offset exists." 408 | }, 409 | "Request-offsetSet": { 410 | "prefix": "Request::offsetSet", 411 | "body": [ 412 | "\\$request->offsetSet('${1:offset}', ${2:\\$value});$3" 413 | ], 414 | "description": "Set the value at the given offset." 415 | }, 416 | "Request-offsetUnset": { 417 | "prefix": "Request::offsetUnset", 418 | "body": [ 419 | "\\$request->offsetUnset('${1:offset}');$2" 420 | ], 421 | "description": "Remove the value at the given offset." 422 | } 423 | } -------------------------------------------------------------------------------- /snippets/response.json: -------------------------------------------------------------------------------- 1 | { 2 | "Response-download.sublime-snippet": { 3 | "prefix": "Response::download", 4 | "body": [ 5 | "return response()->download(${1:\\$pathToFile}, ${2:\\$name}, ${3:\\$headers});" 6 | ], 7 | "description": "Create a File Download Response" 8 | }, 9 | "Response-json.sublime-snippet": { 10 | "prefix": "Response::json", 11 | "body": [ 12 | "return response()->json(${1:\\$data}, ${2:200}, ${3:\\$headers});" 13 | ], 14 | "description": "Create a JSON Response" 15 | }, 16 | "Response-JSONP.sublime-snippet": { 17 | "prefix": "Response::jsonp", 18 | "body": [ 19 | "return response()->jsonp(${1:\\$callback}, ${2:\\$data}, ${3:200}, ${4:\\$headers});" 20 | ], 21 | "description": "Create a JSONP Response" 22 | }, 23 | "Response-make.sublime-snippet": { 24 | "prefix": "Response::make", 25 | "body": [ 26 | "return Response::make(${1:\\$contents}, ${2:200}, ${3:\\$headers});" 27 | ], 28 | "description": "Create a Custom Response" 29 | } 30 | } -------------------------------------------------------------------------------- /snippets/route.json: -------------------------------------------------------------------------------- 1 | { 2 | "Route-any.sublime-snippet": { 3 | "prefix": "Route::any", 4 | "body": [ 5 | "Route::any('${2:users/{id\\}}', function (${3:\\$id}) {", 6 | " $4", 7 | "});" 8 | ], 9 | "description": "Basic Route with Closure." 10 | }, 11 | "Route-closure.sublime-snippet": { 12 | "prefix": "Route::closure", 13 | "body": [ 14 | "Route::${1:get}('${2:users/{id\\}}', function (${3:\\$id}) {", 15 | " $4", 16 | "});" 17 | ], 18 | "description": "Basic Route with Closure." 19 | }, 20 | "Route-controller.sublime-snippet": { 21 | "prefix": "Route::controller", 22 | "body": [ 23 | "Route::controller('${1:users}', '${2:UserController}');" 24 | ], 25 | "description": "Route a controller to a URI with wildcard routing. (Deprecated)" 26 | }, 27 | "Route-controllerAction.sublime-snippet": { 28 | "prefix": "Route-controllerAction", 29 | "body": [ 30 | "Route::${1:get}('${2:users/{id\\}}', [${3:$User}Controller::class, '${4:index}'])->name('${5:user.index}');" 31 | ], 32 | "description": "Basic route to a controller action." 33 | }, 34 | "Route-current": { 35 | "prefix": "Route::current", 36 | "body": "Route::current()", 37 | "description": "Accessing current route; Return type: Illuminate\\Routing\\Route" 38 | }, 39 | "Route-currentRouteName": { 40 | "prefix": "Route::currentRouteName", 41 | "body": "Route::currentRouteName()", 42 | "description": "Accessing current route; Return type: string" 43 | }, 44 | "Route-currentRouteAction.sublime-snippet": { 45 | "prefix": "Route::currentRouteAction", 46 | "body": [ 47 | "Route::currentRouteAction();" 48 | ], 49 | "description": "Get the current route name." 50 | }, 51 | "Route-delete.sublime-snippet": { 52 | "prefix": "Route::delete", 53 | "body": [ 54 | "Route::delete('${1:users/{id\\}}', function (${2:\\$id}) {", 55 | " $3", 56 | "});" 57 | ], 58 | "description": "Basic Delete Route." 59 | }, 60 | "Route-dispatch": { 61 | "prefix": "Route::dispatch", 62 | "body": "Route::dispatch(${1:\\$request});", 63 | "description": "Dispatch the request to the application." 64 | }, 65 | "Route-dispatchToRoute": { 66 | "prefix": "Route::dispatchToRoute", 67 | "body": "Route::dispatchToRoute(${1:\\$request});", 68 | "description": "Dispatch the request to a route and return the response." 69 | }, 70 | "Route-get.sublime-snippet": { 71 | "prefix": "Route::get", 72 | "body": [ 73 | "Route::get('${1:users/{id\\}}', function (${2:\\$id}) {", 74 | " $3", 75 | "});" 76 | ], 77 | "description": "Basic Get Route." 78 | }, 79 | "Router-post.sublime-snippet": { 80 | "prefix": "Route::post", 81 | "body": [ 82 | "Route::post('${1:users/{id\\}}', function (${2:\\$id}) {", 83 | " $3", 84 | "});" 85 | ], 86 | "description": "Basic Post Route." 87 | }, 88 | "Route-get-with-name": { 89 | "prefix": "Route-get-name", 90 | "body": "Route::get('${1:user}', '${2:User}Controller@${3:index}')->name('${4:user}');", 91 | "description": "Get route with naming" 92 | }, 93 | "Route-post-with-name": { 94 | "prefix": "Route-post-name", 95 | "body": "Route::post('${1:user}', '${2:User}Controller@${3:index}')->name('${4:user}');", 96 | "description": "Post route with naming" 97 | }, 98 | "Route-group.sublime-snippet": { 99 | "prefix": "Route::group", 100 | "body": [ 101 | "Route::prefix('${1:admin}')->group(function () {", 102 | " $2", 103 | "});" 104 | ], 105 | "description": "Create a Group of Routes" 106 | }, 107 | "Route-group-middleware": { 108 | "prefix": "Route::group-middleware", 109 | "body": [ 110 | "Route::middleware(['${1:auth}'${2:, '${3:second}'}])->group(function () {", 111 | " $4", 112 | "});" 113 | ], 114 | "description": "Create a Group of Routers with middleware defined in RouteServiceProvider" 115 | }, 116 | "Route-match.sublime-snippet": { 117 | "prefix": "Route::match", 118 | "body": [ 119 | "Route::match([${1:'get', 'post'}], '${2:/user/profile}', function () {", 120 | " $3", 121 | "});" 122 | ], 123 | "description": "Register a new route with the given verbs." 124 | }, 125 | "Route-put.sublime-snippet": { 126 | "prefix": "Route::put", 127 | "body": [ 128 | "Route::put('${1:users/{id\\}}', function (${2:\\$id}) {", 129 | " $3", 130 | "});" 131 | ], 132 | "description": "Basic Put Route." 133 | }, 134 | "Route-resource.sublime-snippet": { 135 | "prefix": "Route::resource", 136 | "body": [ 137 | "Route::resource('${1:user}', ${2:User}Controller::class);" 138 | ], 139 | "description": "Route to a RESTful Controller" 140 | }, 141 | "Route-when.sublime-snippet": { 142 | "prefix": "Route::when", 143 | "body": [ 144 | "\\$router->when('${1:admin/*}', '${2:admin}', ${3:['post']})$4" 145 | ], 146 | "description": "Pattern based filters on routes" 147 | }, 148 | "Router-model.sublime-snippet": { 149 | "prefix": "Route::model", 150 | "body": [ 151 | "\\$router->model('${1:user}', '${2:App\\Models\\User}')$3" 152 | ], 153 | "description": "Register a model binder for a wildcard." 154 | }, 155 | "Router-pattern.sublime-snippet": { 156 | "prefix": "Route::pattern", 157 | "body": [ 158 | "\\$router->pattern('${1:id}', '${2:[0-9]+}')$3" 159 | ], 160 | "description": "Set a global where pattern on all routes." 161 | }, 162 | "Route-redirect": { 163 | "prefix": "Route::redirect", 164 | "body": "Route::redirect('${1:URI}', '${2:URI}', ${3:301});", 165 | "description": "a convenient shortcut for performing a simple redirect" 166 | }, 167 | "Route-view": { 168 | "prefix": "Route::view", 169 | "body": "Route::view('${1:URI}', '${2:viewName}');", 170 | "description": "route only needs to return a view; you may provide an array of data to pass to the view as an optional third argument" 171 | }, 172 | 173 | // Laravel 9.x 174 | 175 | "Route-controller-group": { 176 | "prefix": "Rotue-controller-group", 177 | "body": [ 178 | "Route::controller(${1:Order}Controller::class)->group(function () {", 179 | " Route::get('/${2:orders}/{id}', 'show');", 180 | " Route::post('/${2:orders}', 'store');", 181 | "});" 182 | ], 183 | "description": "Controller route groups (Laravel 9.x)" 184 | }, 185 | "Route-get-scopeBindings": { 186 | "prefix": "Route-get-scopeBindings", 187 | "body": [ 188 | "Route::get('${1:/users/{user\\}/posts/{post\\}}', function (${2:User \\$user, Post \\$post}) {", 189 | " return ${3:\\$post};", 190 | "})->scopeBindings();" 191 | ], 192 | "description": "Scope binding (Laravel 9.x)" 193 | }, 194 | "Route-group-scopeBindings": { 195 | "prefix": "Route-group-scopeBindings", 196 | "body": [ 197 | "Route::scopeBindings()->group(function () {", 198 | " $1", 199 | "});" 200 | ], 201 | "description": "Group scope binding (Laravel 9.x)" 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /snippets/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Table Schema */ 3 | 4 | "Schema-connection.sublime-snippet": { 5 | "prefix": "Schema::connection", 6 | "body": [ 7 | "Schema::connection('${1:foo}')->create('${2:users}', function (${3:\\$table}) {", 8 | " \\$table->bigIncrements('id');$0", 9 | "});" 10 | ], 11 | "description": "Specify connection for schema operation" 12 | }, 13 | "Schema-create-table.sublime-snippet": { 14 | "prefix": "Schema::create-table", 15 | "body": [ 16 | "Schema::create('${1:users}', function (Blueprint \\$table) {", 17 | " \\$table->bigIncrements('id');", 18 | " $0", 19 | " \\$table->timestamps();", 20 | "});" 21 | ], 22 | "description": "Create new table" 23 | }, 24 | "Schema-drop.sublime-snippet": { 25 | "prefix": "Schema::drop", 26 | "body": [ 27 | "Schema::drop('${1:table}');$0" 28 | ], 29 | "description": "Drop an existing database table" 30 | }, 31 | "Schema-dropIfExists.sublime-snippet": { 32 | "prefix": "Schema::dropIfExists", 33 | "body": [ 34 | "Schema::dropIfExists('${1:table}');$0" 35 | ], 36 | "description": "Drop an existing database table if it exists" 37 | }, 38 | "Schema-hasColumn.sublime-snippet": { 39 | "prefix": "Schema::hasColumn", 40 | "body": [ 41 | "if (Schema::hasColumn('${1:table}', '${2:column}')) {", 42 | " $0", 43 | "}" 44 | ], 45 | "description": "Check for existence of column(s)" 46 | }, 47 | "Schema-hasTable.sublime-snippet": { 48 | "prefix": "Schema::hasTable", 49 | "body": [ 50 | "if (Schema::hasTable('${1:table}')) {", 51 | " $0", 52 | "}" 53 | ], 54 | "description": "Check for existence of table" 55 | }, 56 | "Schema-rename-table.sublime-snippet": { 57 | "prefix": "Schema::rename-table", 58 | "body": [ 59 | "Schema::rename(${1:\\$from}, ${2:\\$to});$0" 60 | ], 61 | "description": "Rename an existing database table" 62 | }, 63 | "Schema-table-update.sublime-snippet": { 64 | "prefix": "Schema::table-update", 65 | "body": [ 66 | "Schema::table('${1:users}', function (Blueprint \\$table) {", 67 | " $0", 68 | "});" 69 | ], 70 | "description": "Update an existing table" 71 | }, 72 | 73 | /* Table Column */ 74 | 75 | "table-bigIncrements.sublime-snippet": { 76 | "prefix": "Column::bigIncrements", 77 | "body": [ 78 | "\\$table->bigIncrements('${1:id}');$2" 79 | ], 80 | "description": "Incrementing ID using a \"big integer\" equivalent." 81 | }, 82 | "table-bigInteger.sublime-snippet": { 83 | "prefix": "Column::bigInteger", 84 | "body": [ 85 | "\\$table->bigInteger('${1:votes}')${2:->nullable()}${3:->default(${4:12})};$0" 86 | ], 87 | "description": "BIGINT equivalent to the table" 88 | }, 89 | "table-binary.sublime-snippet": { 90 | "prefix": "Column::binary", 91 | "body": [ 92 | "\\$table->binary('${1:data}')${2:->nullable()}${3:->default(${4:12})};$0" 93 | ], 94 | "description": "BLOB equivalent to the table" 95 | }, 96 | "table-boolean.sublime-snippet": { 97 | "prefix": "Column::boolean", 98 | "body": [ 99 | "\\$table->boolean('${1:confirmed}')${2:->nullable()}${3:->default(${4:false})};$0" 100 | ], 101 | "description": "BOOLEAN equivalent to the table" 102 | }, 103 | "table-char.sublime-snippet": { 104 | "prefix": "Column::char", 105 | "body": [ 106 | "\\$table->char('${1:name}', ${2:4})${2:->nullable()}${3:->default(${4:'text'})};$0" 107 | ], 108 | "description": "CHAR equivalent with a length (optional)" 109 | }, 110 | "table-date.sublime-snippet": { 111 | "prefix": "Column::date", 112 | "body": [ 113 | "\\$table->date('${1:created_at}')${2:->nullable()}${3:->default(${4:new DateTime()})};$0" 114 | ], 115 | "description": "DATE equivalent to the table" 116 | }, 117 | "table-dateTime.sublime-snippet": { 118 | "prefix": "Column::dateTime", 119 | "body": [ 120 | "\\$table->dateTime('${1:created_at}')${2:->nullable()}${3:->default(${4:new DateTime()})};$0" 121 | ], 122 | "description": "DATETIME equivalent to the table" 123 | }, 124 | "table-decimal.sublime-snippet": { 125 | "prefix": "Column::decimal", 126 | "body": [ 127 | "\\$table->decimal('${1:amount}', ${2:5}, ${3:2})${4:->nullable()}${5:->default(${6:123.45})};$0" 128 | ], 129 | "description": "DECIMAL equivalent with a precision and scale" 130 | }, 131 | "table-double.sublime-snippet": { 132 | "prefix": "Column::double", 133 | "body": [ 134 | "\\$table->double('${1:column}', ${2:15}, ${3:8})${4:->nullable()}${5:->default(${6:123.4567})};$0" 135 | ], 136 | "description": "DOUBLE equivalent with precision" 137 | }, 138 | "table-dropColumn.sublime-snippet": { 139 | "prefix": "Column::dropColumn", 140 | "body": [ 141 | "\\$table->dropColumn('${1:column}');$0" 142 | ], 143 | "description": "Drop a column" 144 | }, 145 | "table-dropForeign.sublime-snippet": { 146 | "prefix": "Column::dropForeign", 147 | "body": [ 148 | "\\$table->dropForeign('${1:posts_user_id_foreign}');$0" 149 | ], 150 | "description": "Drop a Foreign Key" 151 | }, 152 | "table-dropIndex.sublime-snippet": { 153 | "prefix": "Column::dropIndex", 154 | "body": [ 155 | "\\$table->dropIndex('${1:geo_state_index}');$0" 156 | ], 157 | "description": "Drop a basic Index" 158 | }, 159 | "table-dropPrimary.sublime-snippet": { 160 | "prefix": "Column::dropPrimary", 161 | "body": [ 162 | "\\$table->dropPrimary('${1:users_id_primary}');$0" 163 | ], 164 | "description": "Drop a Primary key" 165 | }, 166 | "table-dropUnique.sublime-snippet": { 167 | "prefix": "Column::dropUnique", 168 | "body": [ 169 | "\\$table->dropUnique('${1:users_email_unique}');$0" 170 | ], 171 | "description": "Drop a Unique Index" 172 | }, 173 | "table-engine.sublime-snippet": { 174 | "prefix": "Column::engine", 175 | "body": [ 176 | "\\$table->engine = '${1:InnoDB}';$0" 177 | ], 178 | "description": "Set the storage engine for a table" 179 | }, 180 | "table-enum.sublime-snippet": { 181 | "prefix": "Column::enum", 182 | "body": [ 183 | "\\$table->enum('${1:choices}', ${2:['foo', 'bar']})${3:->nullable()}${4:->default(${5:['foo', 'bar']})};$0" 184 | ], 185 | "description": "ENUM equivalent to the table" 186 | }, 187 | "table-float.sublime-snippet": { 188 | "prefix": "Column::float", 189 | "body": [ 190 | "\\$table->float('${1:amount}')${2:->nullable()}${3:->default(${4:123.45})};$0" 191 | ], 192 | "description": "FLOAT equivalent to the table" 193 | }, 194 | "table-increments.sublime-snippet": { 195 | "prefix": "Column::increments", 196 | "body": [ 197 | "\\$table->increments('${1:id}');$0" 198 | ], 199 | "description": "Incrementing ID" 200 | }, 201 | "table-index-foreign.sublime-snippet": { 202 | "prefix": "Column::index-foreign", 203 | "body": [ 204 | "\\$table->foreign('${1:user_id}')->references('${2:id}')->on('${3:users}')${4:->onDelete('${5:cascade}')};$0" 205 | ], 206 | "description": "Add a Foreign Key to a table" 207 | }, 208 | "table-index-index.sublime-snippet": { 209 | "prefix": "Column::index", 210 | "body": [ 211 | "\\$table->index('${1:column}');$0" 212 | ], 213 | "description": "Adding a basic index" 214 | }, 215 | "table-index-primary.sublime-snippet": { 216 | "prefix": "Column::index-primary", 217 | "body": [ 218 | "\\$table->primary('${1:id}');$0" 219 | ], 220 | "description": "Add a primary or array of composite keys" 221 | }, 222 | "table-index-unique.sublime-snippet": { 223 | "prefix": "Column::index-unique", 224 | "body": [ 225 | "\\$table->unique('${1:column}');$0" 226 | ], 227 | "description": "Add a unique index" 228 | }, 229 | "table-integer.sublime-snippet": { 230 | "prefix": "Column::integer", 231 | "body": [ 232 | "\\$table->integer('${1:votes}')${2:->unsigned()}${3:->nullable()}${4:->default(${5:12})};$0" 233 | ], 234 | "description": "INTEGER equivalent to the table" 235 | }, 236 | "table-json.sublime-snippet": { 237 | "prefix": "Column::json", 238 | "body": [ 239 | "\\$table->json('${1:column}')${2:->nullable()};$0" 240 | ], 241 | "description": "JSON equivalent to the table" 242 | }, 243 | "table-jsonb.sublime-snippet": { 244 | "prefix": "Column::jsonb", 245 | "body": [ 246 | "\\$table->jsonb('${1:column}')${2:->nullable()};$0" 247 | ], 248 | "description": "JSON equivalent to the table" 249 | }, 250 | "table-longText.sublime-snippet": { 251 | "prefix": "Column::longText", 252 | "body": [ 253 | "\\$table->longText('${1:description}')${2:->nullable()}${3:->default(${4:'text'})};$0" 254 | ], 255 | "description": "LONGTEXT equivalent to the table" 256 | }, 257 | "table-mediumText.sublime-snippet": { 258 | "prefix": "Column::mediumText", 259 | "body": [ 260 | "\\$table->mediumText('${1:mediumText}')${2:->nullable()}${3:->default(${4:'text'})};$0" 261 | ], 262 | "description": "MEDIUMTEXT equivalent to the table" 263 | }, 264 | "table-morphs.sublime-snippet": { 265 | "prefix": "Column::morphs", 266 | "body": [ 267 | "\\$table->morphs('${1:taggable}');$0" 268 | ], 269 | "description": "Adds INTEGER taggable_id and STRING taggable_type" 270 | }, 271 | "table-rememberToken.sublime-snippet": { 272 | "prefix": "Column::rememberToken", 273 | "body": [ 274 | "\\$table->rememberToken();" 275 | ], 276 | "description": "Adds remember_token as VARCHAR(100) NULL" 277 | }, 278 | "table-renameColumn.sublime-snippet": { 279 | "prefix": "Column::renameColumn", 280 | "body": [ 281 | "\\$table->renameColumn('${1:from}', '${2:to}');$0" 282 | ], 283 | "description": "Rename a column" 284 | }, 285 | "table-smallInteger.sublime-snippet": { 286 | "prefix": "Column::smallInteger", 287 | "body": [ 288 | "\\$table->smallInteger('${1:votes}')${2:->nullable()}${3:->default(${4:12})};$0" 289 | ], 290 | "description": "SMALLINT equivalent to the table" 291 | }, 292 | "table-softDeletes.sublime-snippet": { 293 | "prefix": "Column::softDeletes", 294 | "body": [ 295 | "\\$table->softDeletes();" 296 | ], 297 | "description": "Adds deleted_at column for soft deletes" 298 | }, 299 | "table-string.sublime-snippet": { 300 | "prefix": "Column::string", 301 | "body": [ 302 | "\\$table->string('${1:name}', ${2:100})${3:->nullable()}${5:->default(${6:'text'})};$0" 303 | ], 304 | "description": "VARCHAR equivalent with a length (optional)" 305 | }, 306 | "table-text.sublime-snippet": { 307 | "prefix": "Column::text", 308 | "body": [ 309 | "\\$table->text('${1:description}')${2:->nullable()}${3:->default(${4:'text'})};$0" 310 | ], 311 | "description": "TEXT equivalent to the table" 312 | }, 313 | "table-time.sublime-snippet": { 314 | "prefix": "Column::time", 315 | "body": [ 316 | "\\$table->time('${1:sunrise}')${2:->nullable()}${3:->default(${4:new DateTime()})};$0" 317 | ], 318 | "description": "TIME equivalent to the table" 319 | }, 320 | "table-timestamp.sublime-snippet": { 321 | "prefix": "Column::timestamp", 322 | "body": [ 323 | "\\$table->timestamp('${1:added_on}')${2:->nullable()}${3:->default(${4:time()})};$0" 324 | ], 325 | "description": "TIMESTAMP equivalent to the table" 326 | }, 327 | "table-timestamps.sublime-snippet": { 328 | "prefix": "Column::timestamps", 329 | "body": [ 330 | "\\$table->timestamps();" 331 | ], 332 | "description": "Adds created_at and updated_at columns" 333 | }, 334 | "table-tinyInteger.sublime-snippet": { 335 | "prefix": "Column::tinyInteger", 336 | "body": [ 337 | "\\$table->tinyInteger('${1:numbers}');$0" 338 | ], 339 | "description": "TINYINT equivalent to the table" 340 | }, 341 | "table-uuid.sublime-snippet": { 342 | "prefix": "Column::uuid", 343 | "body": [ 344 | "\\$table->uuid('${1:id}')${2:->nullable()}${3:->default(${4:null})};$0" 345 | ], 346 | "description": "UUID equivalent to the table" 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /snippets/session.json: -------------------------------------------------------------------------------- 1 | { 2 | "Session-all.sublime-snippet": { 3 | "prefix": "Session::all", 4 | "body": [ 5 | "\\$request->session()->all();" 6 | ], 7 | "description": "Retrieve All Data from the Session" 8 | }, 9 | "Session-flash.sublime-snippet": { 10 | "prefix": "Session::flash", 11 | "body": [ 12 | "\\$request->session()->flash('${1:key}', ${2:\\$value});$3" 13 | ], 14 | "description": "Flash an Item in the Session" 15 | }, 16 | "Session-flush.sublime-snippet": { 17 | "prefix": "Session::flush", 18 | "body": [ 19 | "\\$request->session()->flush();" 20 | ], 21 | "description": "Remove All Items from the Session" 22 | }, 23 | "Session-forget.sublime-snippet": { 24 | "prefix": "Session::forget", 25 | "body": [ 26 | "\\$request->session()->forget('${1:key}');$2" 27 | ], 28 | "description": "Remove an Item from the Session" 29 | }, 30 | "Session-get.sublime-snippet": { 31 | "prefix": "Session::get", 32 | "body": [ 33 | "\\$request->session()->get('${1:key}', '${2:default}');$3" 34 | ], 35 | "description": "Retrieve an Item from the Session or Default Value" 36 | }, 37 | "Session-has.sublime-snippet": { 38 | "prefix": "Session::has", 39 | "body": [ 40 | "\\$request->session()->has('${1:key}');$2" 41 | ], 42 | "description": "Determin if an Item Exists in the Session" 43 | }, 44 | "Session-keep.sublime-snippet": { 45 | "prefix": "Session::keep", 46 | "body": [ 47 | "\\$request->session()->keep(${1:['key', 'otherkey']});$2" 48 | ], 49 | "description": "Reflash Only a Subset of Flash Data" 50 | }, 51 | "Session-push.sublime-snippet": { 52 | "prefix": "Session::push", 53 | "body": [ 54 | "\\$request->session()->push('${1:key.subArray}', '${2:value}');$3" 55 | ], 56 | "description": "Push a Value onto an Array Session Value" 57 | }, 58 | "Session-put.sublime-snippet": { 59 | "prefix": "Session::put", 60 | "body": [ 61 | "\\$request->session()->put('${1:key}', ${2:\\$value});$3" 62 | ], 63 | "description": "Store an Item in the Session" 64 | }, 65 | "Session-reflash.sublime-snippet": { 66 | "prefix": "Session::reflash", 67 | "body": [ 68 | "\\$request->session()->reflash();" 69 | ], 70 | "description": "Reflash the Current Flash Data" 71 | }, 72 | "Session-regenerate.sublime-snippet": { 73 | "prefix": "Session::regenerate", 74 | "body": [ 75 | "\\$request->session()->regenerate();" 76 | ], 77 | "description": "Regenerate the Session ID" 78 | } 79 | } -------------------------------------------------------------------------------- /snippets/storage.json: -------------------------------------------------------------------------------- 1 | { 2 | "Storage-allDirectories.sublime-snippet": { 3 | "prefix": "Storage::allDirectories", 4 | "body": [ 5 | "Storage::allDirectories(${1:directory});$2" 6 | ], 7 | "description": "Returns an array of all the directories within a given directory and all of its sub-directories" 8 | }, 9 | "Storage-allFiles.sublime-snippet": { 10 | "prefix": "Storage::allFiles", 11 | "body": [ 12 | "Storage::allFiles(${1:directory});$2" 13 | ], 14 | "description": "Returns an array of all of the files in a directory and it's sub-directories" 15 | }, 16 | "Storage-append.sublime-snippet": { 17 | "prefix": "Storage::append", 18 | "body": [ 19 | "Storage::append(${1:filePath}, ${2:Appended Text});$3" 20 | ], 21 | "description": "Insert content at the end of a file" 22 | }, 23 | "Storage-cleanDirectory.sublime-snippet": { 24 | "prefix": "Storage::cleanDirectory", 25 | "body": [ 26 | "Storage::cleanDirectory(${1:directory});$2" 27 | ], 28 | "description": "Empty the specified directory of all files and folders." 29 | }, 30 | "Storage-copy.sublime-snippet": { 31 | "prefix": "Storage::copy", 32 | "body": [ 33 | "Storage::copy(${1:path}, ${2:target});$3" 34 | ], 35 | "description": "Copy an existing file to another location on the disk" 36 | }, 37 | "Storage-delete.sublime-snippet": { 38 | "prefix": "Storage::delete", 39 | "body": [ 40 | "Storage::delete(${1:['file', 'otherFile']});$2" 41 | ], 42 | "description": "Remove one or multiple files from the disk" 43 | }, 44 | "Storage-deleteDirectory.sublime-snippet": { 45 | "prefix": "Storage::deleteDirectory", 46 | "body": [ 47 | "Storage::deleteDirectory(${1:directory});$2" 48 | ], 49 | "description": "May be used to remove a directory, including all of its files, from the disk" 50 | }, 51 | "Storage-directories.sublime-snippet": { 52 | "prefix": "Storage::directories", 53 | "body": [ 54 | "Storage::directories(${1:directory});$2" 55 | ], 56 | "description": "Returns an array of all the directories within a given directory" 57 | }, 58 | "Storage-exists.sublime-snippet": { 59 | "prefix": "Storage::exists", 60 | "body": [ 61 | "Storage::exists(${1:filePath});$2" 62 | ], 63 | "description": "Determine if a file exists." 64 | }, 65 | "Storage-extension.sublime-snippet": { 66 | "prefix": "Storage::extension", 67 | "body": [ 68 | "Storage::extension(${1:filePath});$2" 69 | ], 70 | "description": "Extract the file extension from a file path." 71 | }, 72 | "Storage-files.sublime-snippet": { 73 | "prefix": "Storage::files", 74 | "body": [ 75 | "Storage::files(${1:directory});$2" 76 | ], 77 | "description": "Returns an array of all of the files in a directory" 78 | }, 79 | "Storage-get.sublime-snippet": { 80 | "prefix": "Storage::get", 81 | "body": [ 82 | "Storage::get(${1:filePath});$2" 83 | ], 84 | "description": "Retrieve the contents of a given file" 85 | }, 86 | "Storage-isDirectory.sublime-snippet": { 87 | "prefix": "Storage::isDirectory", 88 | "body": [ 89 | "Storage::isDirectory(${1:directory});$2" 90 | ], 91 | "description": "Determine if the given path is a directory." 92 | }, 93 | "Storage-isFile.sublime-snippet": { 94 | "prefix": "Storage::isFile", 95 | "body": [ 96 | "Storage::isFile(${1:path});$2" 97 | ], 98 | "description": "Determine if the given path is a directory." 99 | }, 100 | "Storage-isWritable.sublime-snippet": { 101 | "prefix": "Storage::iswritable", 102 | "body": [ 103 | "Storage::isWritable(${1:path});$2" 104 | ], 105 | "description": "Determine if the given path is writable." 106 | }, 107 | "Storage-lastModified.sublime-snippet": { 108 | "prefix": "Storage::lastModified", 109 | "body": [ 110 | "Storage::lastModified(${1:filePath});$2" 111 | ], 112 | "description": "Returns the UNIX timestamp of the last time the file was modified" 113 | }, 114 | "Storage-makeDirectory.sublime-snippet": { 115 | "prefix": "Storage::makeDirectory", 116 | "body": [ 117 | "Storage::makeDirectory(${1:directory});$2" 118 | ], 119 | "description": "Will create the given directory, including any needed sub-directories" 120 | }, 121 | "Storage-mimeType.sublime-snippet": { 122 | "prefix": "Storage::mimeType", 123 | "body": [ 124 | "Storage::mimeType(${1:path});$2" 125 | ], 126 | "description": "Get the mime-type of a given file." 127 | }, 128 | "Storage-move.sublime-snippet": { 129 | "prefix": "Storage::move", 130 | "body": [ 131 | "Storage::move(${1:path}, ${2:target});$3" 132 | ], 133 | "description": "Move an existing file to a new location on the disk" 134 | }, 135 | "Storage-name.sublime-snippet": { 136 | "prefix": "Storage::name", 137 | "body": [ 138 | "Storage::name(${1:filePath});$2" 139 | ], 140 | "description": "Extract the file name from a file path." 141 | }, 142 | "Storage-prepend.sublime-snippet": { 143 | "prefix": "Storage::prepend", 144 | "body": [ 145 | "Storage::prepend(${1:filePath}, ${2:Prepended Text});$3" 146 | ], 147 | "description": "Insert content at the beginning of a file" 148 | }, 149 | "Storage-put.sublime-snippet": { 150 | "prefix": "Storage::put", 151 | "body": [ 152 | "Storage::put(${1:filePath}, ${2:\\$contents});$3" 153 | ], 154 | "description": "Store a file on disk" 155 | }, 156 | "Storage-size.sublime-snippet": { 157 | "prefix": "Storage::size", 158 | "body": [ 159 | "Storage::size(${1:filePath});$2" 160 | ], 161 | "description": "Get the size of the file in bytes" 162 | }, 163 | "Storage-type.sublime-snippet": { 164 | "prefix": "Storage::type", 165 | "body": [ 166 | "Storage::type(${1:filePath});$2" 167 | ], 168 | "description": "Get the file type of a given file." 169 | } 170 | } -------------------------------------------------------------------------------- /snippets/str.json: -------------------------------------------------------------------------------- 1 | { 2 | "Str-of": { 3 | "prefix": "Str::of", 4 | "body": "Str::of(${1:\\$string})", 5 | "description": "Get a new stringable object from the given string. (v7.x)" 6 | }, 7 | "Str-after": { 8 | "prefix": "Str::after", 9 | "body": "Str::after(${1:\\$subject}, '${2:search}')", 10 | "description": "The Str::after method returns everything after the given value in a string. The entire string will be returned if the value does not exist within the string." 11 | }, 12 | "Str-afterLast": { 13 | "prefix": "Str::afterLast", 14 | "body": "Str::afterLast(${1:\\$subject}, '${2:search}')", 15 | "description": "The Str::afterLast method returns everything after the last occurrence of the given value in a string. The entire string will be returned if the value does not exist within the string. (v6.x)" 16 | }, 17 | "Str-ascii": { 18 | "prefix": "Str::ascii", 19 | "body": "Str::ascii('${1:û}')", 20 | "description": "The Str::ascii method will attempt to transliterate the string into an ASCII value." 21 | }, 22 | "Str-before": { 23 | "prefix": "Str::before", 24 | "body": "Str::before(${1:\\$subject}, '${2:search}')", 25 | "description": "Get the portion of a string before the first occurrence of a given value." 26 | }, 27 | "Str-beforeLast": { 28 | "prefix": "Str::beforeLast", 29 | "body": "Str::beforeLast(${1:\\$subject}, '${2:search}')", 30 | "description": "Get the portion of a string before the last occurrence of a given value. (v6.x)" 31 | }, 32 | "Str-between": { 33 | "prefix": "Str::between", 34 | "body": "Str::between(${1:\\$subject}, '${2:from}', '${3:to}')", 35 | "description": "Get the portion of a string between two given values. (v7.x)" 36 | }, 37 | "Str-betweenFirst": { 38 | "prefix": "Str::betweenFirst", 39 | "body": "Str::betweenFirst(${1:\\$subject}, '${2:from}', '${3:to}')", 40 | "description": "Get the smallest possible portion of a string between two values. (v9.2)" 41 | }, 42 | "Str-camel": { 43 | "prefix": "Str::camel", 44 | "body": "Str::camel(${1:\\$value})", 45 | "description": "Convert a value to camel case." 46 | }, 47 | "Str-contains": { 48 | "prefix": "Str::contains", 49 | "body": "Str::contains(${1:\\$haystack}, '${2:needles}')", 50 | "description": "Return boolean. Determine if a given string contains a given substring." 51 | }, 52 | "Str-containsAll": { 53 | "prefix": "Str::containsAll", 54 | "body": "Str::containsAll(${1:\\$haystack}, '${2:needles}')", 55 | "description": "Determine if a given string contains all array values. (v5.8)" 56 | }, 57 | "Str-endsWith": { 58 | "prefix": "Str::endsWith", 59 | "body": "Str::endsWith(${1:\\$haystack}, '${2:needles}')", 60 | "description": "Return boolean. Determine if a given string ends with a given substring." 61 | }, 62 | "Str-finish": { 63 | "prefix": "Str::finish", 64 | "body": "Str::finish(${1:\\$value}, '${2:cap}')", 65 | "description": "Cap a string with a single instance of a given value." 66 | }, 67 | "Str-is": { 68 | "prefix": "Str::is", 69 | "body": "Str::is(${1:\\$pattern}, '${2:value}')", 70 | "description": "Return boolean. Determine if a given string matches a given pattern." 71 | }, 72 | "Str-isAscii": { 73 | "prefix": "Str::isAscii", 74 | "body": "Str::isAscii(${1:\\$value})", 75 | "description": "Determine if a given string is 7 bit ASCII. (v7.x)" 76 | }, 77 | "Str-isUuid": { 78 | "prefix": "Str::isUuid", 79 | "body": "Str::isUuid(${1:\\$value})", 80 | "description": "Return boolean. Determine if a given string is a valid UUID. (v6.x)" 81 | }, 82 | "Str-kebab": { 83 | "prefix": "Str::kebab", 84 | "body": "Str::kebab(${1:\\$value})", 85 | "description": "Convert a string to kebab case." 86 | }, 87 | "Str-lcfirst": { 88 | "prefix": "Str::lcfirst", 89 | "body": "Str::lcfirst(${1:\\$value})", 90 | "description": "Return string with first character lowercase. (v9.4)" 91 | }, 92 | "Str-length": { 93 | "prefix": "Str::length", 94 | "body": "Str::length(${1:\\$value})", 95 | "description": "Return the length of the given string." 96 | }, 97 | "Str-limit": { 98 | "prefix":"Str::limit", 99 | "body": "Str::limit(${1:\\$string}, ${2:\\$limit}, '${3:...}')", 100 | "description": "Truncates the given string at the specified length" 101 | }, 102 | "Str-lower": { 103 | "prefix": "Str::lower", 104 | "body": "Str::lower(${1:\\$value})", 105 | "description": "Convert the given string to lower-case." 106 | }, 107 | "Str-words": { 108 | "prefix": "Str::words", 109 | "body": "Str::words(${1:\\$value}, ${2:\\$words}, '${3:...}')", 110 | "description": "Limit the number of words in a string." 111 | }, 112 | "Str-parseCallback": { 113 | "prefix": "Str::parseCallback", 114 | "body": "Str::parseCallback('${1:callback}', ${2:\\$default})", 115 | "description": "Return array. Parse a Class@method style callback into class and method. $default is null or given string." 116 | }, 117 | "Str-plural": { 118 | "prefix":"Str::plural", 119 | "body": "Str::plural(${1:\\$value}, ${2:\\$count})", 120 | "description": "Get the plural form of an English word." 121 | }, 122 | "Str-pluralStudly": { 123 | "prefix":"Str::pluralStudly", 124 | "body": "Str::pluralStudly(${1:\\$value}, ${2:\\$count})", 125 | "description": "Pluralize the last word of an English, studly caps case string. (v5.8)" 126 | }, 127 | "Str-random": { 128 | "prefix": "Str::random", 129 | "body": "Str::random(${1:\\$length})", 130 | "description": "Generate a more truly random alpha-numeric string." 131 | }, 132 | "Str-replaceArray": { 133 | "prefix": "Str::replaceArray", 134 | "body": "Str::replaceArray('${1:search}', '${2:replace}', ${3:\\$subject})", 135 | "description": "Replace a given value in the string sequentially with an array." 136 | }, 137 | "Str-replaceFirst": { 138 | "prefix": "Str::replaceFirst", 139 | "body": "Str::replaceFirst('${1:search}', '${2:replace}', ${3:\\$subject})", 140 | "description": "Replace the first occurrence of a given value in the string." 141 | }, 142 | "Str-replaceLast": { 143 | "prefix": "Str::replaceLast", 144 | "body": "Str::replaceLast('${1:search}', '${2:replace}', ${3:\\$subject})", 145 | "description": "Replace the last occurrence of a given value in the string." 146 | }, 147 | "Str-start": { 148 | "prefix": "Str::start", 149 | "body": "Str::start(${1:\\$value}, '${2:prefix}')", 150 | "description": "Begin a string with a single instance of a given value." 151 | }, 152 | "Str-upper": { 153 | "prefix": "Str::upper", 154 | "body": "Str::upper(${1:\\$value})", 155 | "description": "Convert the given string to upper-case." 156 | }, 157 | "Str-title": { 158 | "prefix": "Str::title", 159 | "body": "Str::title(${1:\\$value})", 160 | "description": "Convert the given string to title case." 161 | }, 162 | "Str-singular": { 163 | "prefix": "Str::singular", 164 | "body": "Str::singular(${1:\\$value})", 165 | "description": "Get the singular form of an English word." 166 | }, 167 | "Str-slug": { 168 | "prefix": "Str::slug", 169 | "body": "Str::slug(${1:\\$title})", 170 | "description": "Generate a URL friendly slug from a given string." 171 | }, 172 | "Str-snake": { 173 | "prefix": "Str::snake", 174 | "body": "Str::snake(${1:\\$value})", 175 | "description": "Convert a string to snake case." 176 | }, 177 | "Str-startsWith": { 178 | "prefix": "Str::startsWith", 179 | "body": "Str::startsWith(${1:\\$haystack}, '${2:needles}')", 180 | "description": "Return boolean. Determine if a given string starts with a given substring." 181 | }, 182 | "Str-studly": { 183 | "prefix": "Str::studly", 184 | "body": "Str::studly(${1:\\$value})", 185 | "description": "Convert a value to studly caps case." 186 | }, 187 | "Str-substr": { 188 | "prefix": "Str::substr", 189 | "body": "Str::substr(${1:\\$string}, ${2:\\$start}, ${3:\\$length})", 190 | "description": "Returns the portion of string specified by the start and length parameters." 191 | }, 192 | "Str-substrCount": { 193 | "prefix": "Str::substrCount", 194 | "body": "Str::substrCount(${1:\\$haystack}, ${2:\\$needle}, ${3:\\$offset}, ${4:\\$length})", 195 | "description": "Returns the number of substring occurrences. (v7.x)" 196 | }, 197 | "Str-ucfirst": { 198 | "prefix": "Str::ucfirst", 199 | "body": "Str::ucfirst(${1:\\$string})", 200 | "description": "Make a string's first character uppercase." 201 | }, 202 | "Str-uuid": { 203 | "prefix": "Str::uuid", 204 | "body": "Str::uuid()", 205 | "description": "Generate a UUID (version 4)." 206 | }, 207 | "Str-orderedUuid": { 208 | "prefix": "Str::orderedUuid", 209 | "body": "Str::orderedUuid()", 210 | "description": "Generate a time-ordered UUID (version 4)." 211 | }, 212 | "Str-createUuidsUsing": { 213 | "prefix": "Str::createUuidsUsing", 214 | "body": "Str::createUuidsUsing(${1:callable})", 215 | "description": "void. Set the callable that will be used to generate UUIDs. (v6.x)" 216 | }, 217 | "Str-createUuidsNormally": { 218 | "prefix": "Str::createUuidsNormally", 219 | "body": "Str::createUuidsNormally()", 220 | "description": "void. Indicate that UUIDs should be created normally and not using a custom factory. (v6.x)" 221 | }, 222 | "Str-wrap": { 223 | "prefix": "Str::wrap", 224 | "body": "Str::wrap(${1:\\$value}, ${2:\\$prefix}, ${3:\\$suffix})", 225 | "description": "Wrap the given string in a HTML tag. (v9.5)" 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /snippets/view.json: -------------------------------------------------------------------------------- 1 | { 2 | "View-composer.sublime-snippet": { 3 | "prefix": "View::composer", 4 | "body": [ 5 | "view()->composer('${1:name}', function (${2:\\$view}) {", 6 | " $3", 7 | "});" 8 | ], 9 | "description": "Define a View Composer" 10 | }, 11 | "View-composerClass.sublime-snippet": { 12 | "prefix": "View::composerClass", 13 | "body": [ 14 | "view()->composer('${1:name}', '${2:App\\Http\\ViewComposers\\SomeComposer}');$3" 15 | ], 16 | "description": "Define a Class-based View Composer" 17 | }, 18 | "View-exists.sublime-snippet": { 19 | "prefix": "View::exists", 20 | "body": [ 21 | "if (view()->exists('${1:view.name}'))", 22 | "{", 23 | " $2", 24 | "}" 25 | ], 26 | "description": "Determine if a view exists" 27 | }, 28 | "View-make.sublime-snippet": { 29 | "prefix": "View::make", 30 | "body": [ 31 | "view('${1:view.name}', ${2:\\$data});$3" 32 | ], 33 | "description": "Create a View with Data" 34 | }, 35 | "View-makeCompact.sublime-snippet": { 36 | "prefix": "View::makeCompact", 37 | "body": [ 38 | "view('${1:view.name}', compact('${2:data}'));$3" 39 | ], 40 | "description": "Create a View, Pass Data with compact()" 41 | }, 42 | "View-makeWith.sublime-snippet": { 43 | "prefix": "View::makeWith", 44 | "body": [ 45 | "view(${1:'view.name'})->with('${2:key}', ${3:\\$value});$4" 46 | ], 47 | "description": "Create a View, Pass Data using with()" 48 | }, 49 | "View-render.sublime-snippet": { 50 | "prefix": "View::render", 51 | "body": [ 52 | "view(${1:'name'}, ${2:\\$data})->render();$3" 53 | ], 54 | "description": "Render a view with some data" 55 | }, 56 | "View-share.sublime-snippet": { 57 | "prefix": "View::share", 58 | "body": [ 59 | "view()->share('${1:key}', ${2:\\$value});$3" 60 | ], 61 | "description": "Share Data across all Views" 62 | } 63 | } --------------------------------------------------------------------------------