Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 103f822

Browse files
authored
Merge pull request #1 from ahinkle/dev
Bug Fix: Update casts type to Array
2 parents d4e9517 + fc2b8fa commit 103f822

File tree

2 files changed

+76
-76
lines changed

2 files changed

+76
-76
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "laravel-model-snippets",
33
"displayName": "Laravel Model Snippets",
44
"description": "Quickly get up and running with your Laravel Models",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"publisher": "ahinkle",
77
"engines": {
88
"vscode": "^1.25.0"

snippets/model.json

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Laravel Model: Table": {
2+
"Laravel Model: Table": {
33
"prefix": "Model::t",
44
"body": [
55
"/**",
@@ -10,8 +10,8 @@
1010
"protected \\$table = '$0';"
1111
],
1212
"description": "Protected Table: The table associated with the model."
13-
},
14-
"Laravel Model: Primary Key": {
13+
},
14+
"Laravel Model: Primary Key": {
1515
"prefix": "Model::pk",
1616
"body": [
1717
"/**",
@@ -22,8 +22,8 @@
2222
"protected \\$primaryKey = '$0';"
2323
],
2424
"description": "Primary Key: The primary key associated with the table."
25-
},
26-
"Laravel Model: Timestamps": {
25+
},
26+
"Laravel Model: Timestamps": {
2727
"prefix": "Model::ts",
2828
"body": [
2929
"/**",
@@ -34,8 +34,8 @@
3434
" public \\$timestamps = ${1:false};"
3535
],
3636
"description": "Timestamps: Indicates if the model should be timestamped."
37-
},
38-
"Laravel Model: Date Format": {
37+
},
38+
"Laravel Model: Date Format": {
3939
"prefix": "Model::df",
4040
"body": [
4141
"/**",
@@ -46,8 +46,8 @@
4646
" protected \\$dateFormat = '$0';"
4747
],
4848
"description": "Date Format: The storage format of the model's date columns."
49-
},
50-
"Laravel Model: Database Connection": {
49+
},
50+
"Laravel Model: Database Connection": {
5151
"prefix": "Model::con",
5252
"body": [
5353
"/**",
@@ -58,22 +58,22 @@
5858
" protected \\$connection = '$0';"
5959
],
6060
"description": "Datebase Connection: The connection name for the model."
61-
},
62-
"Laravel Model: Attribute Casting": {
61+
},
62+
"Laravel Model: Attribute Casting": {
6363
"prefix": "Model::c",
6464
"body": [
6565
"/**",
6666
" * The attributes that should be cast to native types.",
6767
" *",
68-
" * @var string",
68+
" * @var array",
6969
" */",
7070
" protected \\$casts = [",
71-
"\t'$1' => '${0:type}',",
72-
" ];"
71+
"\t'$1' => '${0:type}',",
72+
" ];"
7373
],
7474
"description": "Attribute Casting: he attributes that should be cast to native types within your model."
75-
},
76-
"Laravel Model: Mass Assignment (Fillable) ": {
75+
},
76+
"Laravel Model: Mass Assignment (Fillable) ": {
7777
"prefix": "Model::f",
7878
"body": [
7979
"/**",
@@ -84,8 +84,8 @@
8484
" protected \\$fillable = ['$0'];"
8585
],
8686
"description": "Mass Assignment (Fillable): The attributes that are mass assignable."
87-
},
88-
"Laravel Model: Guard Attributes": {
87+
},
88+
"Laravel Model: Guard Attributes": {
8989
"prefix": "Model::g",
9090
"body": [
9191
"/**",
@@ -96,8 +96,8 @@
9696
" protected \\$guarded = [$0];"
9797
],
9898
"description": "Guard Attributes: The attributes that aren't mass assignable."
99-
},
100-
"Laravel Model: Dates": {
99+
},
100+
"Laravel Model: Dates": {
101101
"prefix": "Model::d",
102102
"body": [
103103
"/**",
@@ -108,8 +108,8 @@
108108
" protected \\$dates = ['${0:deleted_at}'];"
109109
],
110110
"description": "Dates: The attributes that should be mutated to dates."
111-
},
112-
"Laravel Model: Boot": {
111+
},
112+
"Laravel Model: Boot": {
113113
"prefix": "Model::b",
114114
"body": [
115115
"/**",
@@ -125,8 +125,8 @@
125125
" }"
126126
],
127127
"description": "Boot: The \"booting\" method of the model."
128-
},
129-
"Laravel Model: Local Scope": {
128+
},
129+
"Laravel Model: Local Scope": {
130130
"prefix": "Model::s",
131131
"body": [
132132
"/**",
@@ -141,18 +141,18 @@
141141
" }"
142142
],
143143
"description": "Local Scope: Query a local scope within your model."
144-
},
145-
"Laravel Model: One to One Relationship": {
144+
},
145+
"Laravel Model: One to One Relationship": {
146146
"prefix": "Model::oo",
147147
"body": [
148148
"public function $1()",
149-
"{",
150-
"\treturn \\$this->hasOne('App\\\\$0');",
151-
"}"
149+
"{",
150+
"\treturn \\$this->hasOne('App\\\\$0');",
151+
"}"
152152
],
153153
"description": "One to One: Define a One to One relationship within your model."
154-
},
155-
"Laravel Model: Belongs To Relationship": {
154+
},
155+
"Laravel Model: Belongs To Relationship": {
156156
"prefix": "Model::bt",
157157
"body": [
158158
"public function $1()",
@@ -161,8 +161,8 @@
161161
"}"
162162
],
163163
"description": "Belongs To: Define a Belongs To relationship within your model."
164-
},
165-
"Laravel Model: One to Many": {
164+
},
165+
"Laravel Model: One to Many": {
166166
"prefix": "Model::om",
167167
"body": [
168168
"public function $1()",
@@ -171,8 +171,8 @@
171171
"}"
172172
],
173173
"description": "One to Many: Define a One to Many relationship within your model."
174-
},
175-
"Laravel Model: Many to Many": {
174+
},
175+
"Laravel Model: Many to Many": {
176176
"prefix": "Model::mm",
177177
"body": [
178178
"public function $1()",
@@ -181,8 +181,8 @@
181181
"}"
182182
],
183183
"description": "Many to Many: Define a Many to Many relationship within your model."
184-
},
185-
"Laravel Model: Belongs to Many": {
184+
},
185+
"Laravel Model: Belongs to Many": {
186186
"prefix": "Model::btm",
187187
"body": [
188188
"public function $1()",
@@ -191,8 +191,8 @@
191191
"}"
192192
],
193193
"description": "Belongs to Many: Define a Belongs to Many relationship within your model."
194-
},
195-
"Laravel Model: Has Many Through": {
194+
},
195+
"Laravel Model: Has Many Through": {
196196
"prefix": "Model::hmt",
197197
"body": [
198198
"public function $1()",
@@ -202,40 +202,40 @@
202202
],
203203
"description": "Has Many Through: Define a Has Many Through relationship within your model."
204204
},
205-
"Laravel Model: Hidden": {
206-
"prefix": "Model::h",
207-
"body": [
208-
"/**",
209-
" * The attributes that should be hidden for arrays.",
210-
" *",
211-
" * @var array",
212-
" */",
213-
" protected \\$hidden = ['$0'];"
214-
],
215-
"description": "Hidden: The attributes that should be hidden for arrays."
216-
},
217-
"Laravel Model: Visible": {
218-
"prefix": "Model::v",
219-
"body": [
220-
"/**",
221-
" * The attributes that should be visible in arrays.",
222-
" *",
223-
" * @var array",
224-
" */",
225-
" protected \\$visible = ['$0'];"
226-
],
227-
"description": "Visible: The attributes that should be visible in arrays."
228-
},
229-
"Laravel Model: Appends": {
230-
"prefix": "Model::a",
231-
"body": [
232-
"/**",
233-
" * The accessors to append to the model's array form.",
234-
" *",
235-
" * @var array",
236-
" */",
237-
" protected \\$appends = ['$0'];"
238-
],
239-
"description": "Appends: The accessors to append to the model's array form."
240-
}
205+
"Laravel Model: Hidden": {
206+
"prefix": "Model::h",
207+
"body": [
208+
"/**",
209+
" * The attributes that should be hidden for arrays.",
210+
" *",
211+
" * @var array",
212+
" */",
213+
" protected \\$hidden = ['$0'];"
214+
],
215+
"description": "Hidden: The attributes that should be hidden for arrays."
216+
},
217+
"Laravel Model: Visible": {
218+
"prefix": "Model::v",
219+
"body": [
220+
"/**",
221+
" * The attributes that should be visible in arrays.",
222+
" *",
223+
" * @var array",
224+
" */",
225+
" protected \\$visible = ['$0'];"
226+
],
227+
"description": "Visible: The attributes that should be visible in arrays."
228+
},
229+
"Laravel Model: Appends": {
230+
"prefix": "Model::a",
231+
"body": [
232+
"/**",
233+
" * The accessors to append to the model's array form.",
234+
" *",
235+
" * @var array",
236+
" */",
237+
" protected \\$appends = ['$0'];"
238+
],
239+
"description": "Appends: The accessors to append to the model's array form."
240+
}
241241
}

0 commit comments

Comments
 (0)