Skip to content

Instantly share code, notes, and snippets.

@thecodeholic
Created February 26, 2024 19:29
Show Gist options
  • Save thecodeholic/806a41fda32cfb1c7790669862cf5c80 to your computer and use it in GitHub Desktop.
Save thecodeholic/806a41fda32cfb1c7790669862cf5c80 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"
}
}
@md-mostafa-khan
Copy link

"function with Request ": {
"prefix": "fr",
"body": [
"function ${1:ফাংশনের নাম লেখ}(${2|Request $request|}){",
" return $3;",
"}"
],
"description": "create controller function"

@alfatihart
Copy link

"Create enum class": {
	"prefix": "enum",
	"body": [
		"<?php",
		"namespace App\\Enums;\n",
		"enum $1: string",
		"{",
		"\tcase $2 = '$3';",
		"\t$0",
		"}"
	],
	"description": "Create enum class"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment