-
Notifications
You must be signed in to change notification settings - Fork 31
/
php-snippet.txt
134 lines (134 loc) · 3.11 KB
/
php-snippet.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"route get": {
"prefix": "rget",
"body": [
// "Route::get('/$1',[${2:controller}::class,'${3:function name}'])->name('${4:route name}');"
"Route::get('/$1','$2')->name('${3:route name}');"
],
"description": "route get"
},
"route post": {
"prefix": "rpost",
"body": [
// "Route::post('/$1',[${2:controller}::class,'${3:function name}'])->name('${4:route name}');"
"Route::post('/$1','$2')->name('${3:route name}');"
],
"description": "route post"
},
"rgroup": {
"prefix": "rgroup",
"body": [
"Route::group( ['prefix'=>'','middleware'=>[''] ],function(){",
" $1",
"});"
],
"description": "rgroup"
},
"function with request": {
"prefix": "fnr",
"body": [
"public function ${1:function_name}(Request \\$request)",
"{",
" ${2://function_body}",
"}"
],
"description": "function with request"
},
"function": {
"prefix": "fn",
"body": [
"public function ${1:function_name}($2)",
"{",
" ${3://function_body}",
"}"
],
"description": "function"
},
"return view": {
"prefix": "rv",
"body": [
"return view('$1');",
],
"description": "return view"
},
"return view compact": {
"prefix": "rvc",
"body": [
"return view('$1',compact('${2:variable}'));",
],
"description": "return view compact"
},
"return redirect back": {
"prefix": "rback",
"body": [
"return redirect()->back()->with('success','$1');",
],
"description": "return redirect back"
},
"php raw": {
"prefix": "phpraw",
"body": [
"<?php",
" $1",
"?>",
],
"description": "return view compact"
},
"table interger": {
"prefix": "tabint",
"body": [
"\\$table->integer('$1')->nullable();"
],
"description": "table int"
},
"table string": {
"prefix": "tabstring",
"body": [
"\\$table->string('$1',${2:100})->nullable();"
],
"description": "table string"
},
"table text": {
"prefix": "tabtext",
"body": [
"\\$table->text('$1')->nullable();"
],
"description": "table text"
},
"table float": {
"prefix": "tabfloat",
"body": [
"\\$table->float('$1')->nullable();"
],
"description": "table float"
},
"return back with success": {
"prefix": "returnsuccess",
"body": [
"return redirect()->back()->with('success','$1 successfully');"
],
"description": "table default"
},
"table default": {
"prefix": "tabdefault",
"body": [
"\\$table->string('creator',100)->nullable();",
"\\$table->string('slug',100)->nullable();",
"\\$table->integer('status')->default(1);",
],
"description": "table default"
},
}