Skip to content

Instantly share code, notes, and snippets.

@AbiruzzamanMolla
Forked from thecodeholic/php.json
Created February 27, 2024 09:50
Show Gist options
  • Save AbiruzzamanMolla/b10301d5b95c13b4cef78723234dbd7e to your computer and use it in GitHub Desktop.
Save AbiruzzamanMolla/b10301d5b95c13b4cef78723234dbd7e to your computer and use it in GitHub Desktop.
PHP/Laravel Live snippets for VSCode
{
"Create public function": {
"prefix": "pubf",
"body": [
"public function $1()",
"{",
"\t$2",
"}",
],
"description": "Create public function"
},
"Create private function": {
"prefix": "prif",
"body": [
"private function $1()",
"{",
"\t$2",
"}",
],
"description": "Create private function"
},
"Create protected function": {
"prefix": "prof",
"body": [
"protected function $1()",
"{",
"\t$2",
"}",
],
"description": "Create protected function"
},
"Create public static function": {
"prefix": "pubsf",
"body": [
"public static function $1()",
"{",
"\t$2",
"}",
],
"description": "Create public static function"
},
"Create private static function": {
"prefix": "prif",
"body": [
"private static function $1()",
"{",
"\t$2",
"}",
],
"description": "Create private static function"
},
"Create protected static function": {
"prefix": "prof",
"body": [
"protected static function $1()",
"{",
"\t$2",
"}",
],
"description": "Create protected static function"
},
"Create public function with belongsTo": {
"prefix": "belongs",
"body": [
"public function $1()",
"{",
"\treturn \\$this->belongsTo($2::class);",
"}",
],
"description": "Create public function with belongsTo"
},
"Create public function with has many": {
"prefix": "hasm",
"body": [
"public function $1()",
"{",
"\treturn \\$this->hasMany($2::class);",
"}",
],
"description": "Create public function with has many"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment