mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 16:39:04 +02:00
34 lines
1.1 KiB
JSON
34 lines
1.1 KiB
JSON
|
{
|
||
|
"eloquent-getter": {
|
||
|
"prefix": "Eloquent-getter",
|
||
|
"body": [
|
||
|
"public function get${1:Name}Attribute(\\$value) {",
|
||
|
" return ${2:strtoupper(\\$value)};",
|
||
|
"}"
|
||
|
],
|
||
|
"description": "Eloquent getter (Laravel 5.1+)"
|
||
|
},
|
||
|
"eloquent-setter": {
|
||
|
"prefix": "Eloquent-setter",
|
||
|
"body": [
|
||
|
"public function set${1:Name}Attribute(\\$value) {",
|
||
|
" \\$this->attributes['${2:column}'] = ${3:\\$value};",
|
||
|
"}"
|
||
|
],
|
||
|
"description": "Eloquent setter (Laravel 5.1+)"
|
||
|
},
|
||
|
"eloquent-attribute": {
|
||
|
"prefix": "Eloquent-attribute",
|
||
|
"body": [
|
||
|
"public function ${1:name}(): Attribute",
|
||
|
"{",
|
||
|
" return new Attribute(",
|
||
|
" get: fn (\\$value) => ${2:strtoupper(\\$value)},",
|
||
|
" set: fn (\\$value) => ${3:\\$value},",
|
||
|
" );",
|
||
|
"}"
|
||
|
],
|
||
|
"description": "Eloquent accessors / mutators (Laravel 9.x)"
|
||
|
}
|
||
|
}
|