Snippets
This commit is contained in:
@@ -170,7 +170,7 @@ return {
|
||||
s(etr('return ', 'Add semicolon after return'), fmta('return #~;', { i(0) })),
|
||||
s(atr(' use ', 'Add use to function'), fmta(' use (#~)', { i(0) })),
|
||||
s(etr('rt ', 'return alias'), fmta('return #~;', { i(0) })),
|
||||
bs(etr('fn ', 'Shorthand function block'), {
|
||||
bs(atr('fn ', 'Shorthand function block'), {
|
||||
c(1, {
|
||||
sn(nil, fmta('fn (#~) => #~', { i(1), i(2) })),
|
||||
sn(
|
||||
@@ -186,7 +186,7 @@ return {
|
||||
),
|
||||
}),
|
||||
}),
|
||||
bs(etr('fun ', 'Shorthand function block'), {
|
||||
bs(atr('fun ', 'Shorthand function block'), {
|
||||
c(1, {
|
||||
sn(
|
||||
nil,
|
||||
@@ -371,7 +371,7 @@ return {
|
||||
-------------
|
||||
s(
|
||||
etr('bt', 'belongsTo Laravel relationship method'),
|
||||
c(0, {
|
||||
c(1, {
|
||||
sn(
|
||||
nil,
|
||||
fmta(
|
||||
@@ -384,7 +384,7 @@ return {
|
||||
return $this->belongsTo(#~::class);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(0), i(1) }
|
||||
{ rep(1), i(2), i(1) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -399,14 +399,14 @@ return {
|
||||
return $this->belongsTo(#~::class, #~);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(2), i(1), i(0) }
|
||||
{ rep(1), i(2), i(1), i(3) }
|
||||
)
|
||||
),
|
||||
})
|
||||
),
|
||||
s(
|
||||
etr('hm', 'hasMany Laravel relationship method'),
|
||||
c(0, {
|
||||
c(1, {
|
||||
sn(
|
||||
nil,
|
||||
fmta(
|
||||
@@ -419,7 +419,7 @@ return {
|
||||
return $this->hasOne(#~::class);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(0), i(1) }
|
||||
{ rep(1), i(2), i(1) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -434,14 +434,14 @@ return {
|
||||
return $this->hasOne(#~::class, #~);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(2), i(1), i(0) }
|
||||
{ rep(1), i(2), i(1), i(3) }
|
||||
)
|
||||
),
|
||||
})
|
||||
),
|
||||
s(
|
||||
etr('ho', 'hasOne Laravel relationship method'),
|
||||
c(0, {
|
||||
c(1, {
|
||||
sn(
|
||||
nil,
|
||||
fmta(
|
||||
@@ -454,7 +454,7 @@ return {
|
||||
return $this->hasOne(#~::class);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(0), i(1) }
|
||||
{ rep(1), i(2), i(1) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -469,14 +469,14 @@ return {
|
||||
return $this->hasOne(#~::class, #~);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(2), i(1), i(0) }
|
||||
{ rep(1), i(2), i(1), i(3) }
|
||||
)
|
||||
),
|
||||
})
|
||||
),
|
||||
s(
|
||||
etr('bm', 'belongsToMany Laravel relationship method'),
|
||||
c(0, {
|
||||
c(1, {
|
||||
sn(
|
||||
nil,
|
||||
fmta(
|
||||
@@ -489,7 +489,7 @@ return {
|
||||
return $this->belongsToMany(#~::class, #~);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(2), i(1), i(0) }
|
||||
{ rep(1), i(2), i(1), i(3) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -504,16 +504,16 @@ return {
|
||||
return $this->belongsToMany(#~::class, #~, #~);
|
||||
}
|
||||
]],
|
||||
{ rep(1), i(2), i(1), i(3), i(0) }
|
||||
{ rep(1), i(2), i(1), i(3), i(4) }
|
||||
)
|
||||
),
|
||||
})
|
||||
),
|
||||
s(
|
||||
atr('->wr', 'Eloquent where method'),
|
||||
c(0, {
|
||||
sn(nil, fmta("->where('#~', #~)", { i(1), i(0) })),
|
||||
sn(nil, fmta('->where(fn ($query) => #~)', { i(0) })),
|
||||
c(1, {
|
||||
sn(nil, fmta("->where('#~', #~)", { i(1), i(2) })),
|
||||
sn(nil, fmta('->where(fn ($query) => #~)', { i(1) })),
|
||||
sn(
|
||||
nil,
|
||||
fmta(
|
||||
@@ -522,7 +522,7 @@ return {
|
||||
#~
|
||||
})
|
||||
]],
|
||||
{ i(0) }
|
||||
{ i(1) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -533,7 +533,7 @@ return {
|
||||
#~
|
||||
})
|
||||
]],
|
||||
{ i(1), i(0) }
|
||||
{ i(1), i(2) }
|
||||
)
|
||||
),
|
||||
})
|
||||
@@ -541,8 +541,8 @@ return {
|
||||
s(atr('->wi', 'Eloquent where in method'), fmta("->whereIn('#~', #~)", { i(1), i(0) })),
|
||||
s(atr('->wn', 'Eloquent where not in method'), fmta("->whereNotIn('#~', #~)", { i(1), i(0) })),
|
||||
s(
|
||||
atr('->wh', 'Eloquent where has method'),
|
||||
c(0, {
|
||||
atr('->wha', 'Eloquent where has method'),
|
||||
c(1, {
|
||||
sn(nil, fmta("->whereHas('#~')", { i(1) })),
|
||||
sn(nil, fmta("->whereHas('#~', fn ($query) => #~)", { i(1), i(0) })),
|
||||
sn(
|
||||
@@ -553,7 +553,7 @@ return {
|
||||
#~
|
||||
})
|
||||
]],
|
||||
{ i(1), i(0) }
|
||||
{ i(1), i(1) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -564,14 +564,14 @@ return {
|
||||
#~
|
||||
})
|
||||
]],
|
||||
{ i(1), i(2), i(0) }
|
||||
{ i(1), i(2), i(3) }
|
||||
)
|
||||
),
|
||||
})
|
||||
),
|
||||
s(
|
||||
atr('->we', 'Eloquent where exists method'),
|
||||
c(0, {
|
||||
c(1, {
|
||||
sn(nil, fmta('->whereExists(fn ($query) => #~)', { i(0) })),
|
||||
sn(
|
||||
nil,
|
||||
@@ -581,7 +581,7 @@ return {
|
||||
#~
|
||||
})
|
||||
]],
|
||||
{ i(0) }
|
||||
{ i(1) }
|
||||
)
|
||||
),
|
||||
sn(
|
||||
@@ -592,7 +592,7 @@ return {
|
||||
#~
|
||||
})
|
||||
]],
|
||||
{ i(1), i(0) }
|
||||
{ i(1), i(2) }
|
||||
)
|
||||
),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user