
$themeAssets = ThemeAsset::select('asset_key')->where('theme_id', '9994a913-4383-423c-993e-21acde47dbe3')->where('category', ThemeAsset::CATEGORY_MIGRATION)->get();
Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => Modules\ThemeStoreDb\Models\ThemeAsset Object
(
[forceDeleteVersion:protected] =>
[table:protected] => theme_asset2
[connection:protected] => mysql
[primaryKey:protected] => id
[keyType:protected] => int
[incrementing] => 1
[with:protected] => Array
(
)
[withCount:protected] => Array
(
)
[perPage:protected] => 15
[exists] => 1
[wasRecentlyCreated] =>
[attributes:protected] => Array
(
[asset_key] => migrations/migrate_cart.blade.php
)
[original:protected] => Array
(
[asset_key] => migrations/migrate_cart.blade.php
)
[changes:protected] => Array
(
)
[casts:protected] => Array
(
)
[dates:protected] => Array
(
)
[dateFormat:protected] =>
[appends:protected] => Array
(
[0] => created_at
[1] => updated_at
)
[dispatchesEvents:protected] => Array
(
)
[observables:protected] => Array
(
)
[relations:protected] => Array
(
)
[touches:protected] => Array
(
)
[timestamps] => 1
[hidden:protected] => Array
(
)
[visible:protected] => Array
(
)
[guarded:protected] => Array
(
[0] => *
)
)
[1] => Modules\ThemeStoreDb\Models\ThemeAsset Object
(
[forceDeleteVersion:protected] =>
[table:protected] => theme_asset2
[connection:protected] => mysql
[primaryKey:protected] => id
[keyType:protected] => int
[incrementing] => 1
[with:protected] => Array
(
)
[withCount:protected] => Array
(
)
[perPage:protected] => 15
[exists] => 1
[wasRecentlyCreated] =>
[attributes:protected] => Array
(
[asset_key] => migrations/migrate_collections.blade.php
)
[original:protected] => Array
(
[asset_key] => migrations/migrate_collections.blade.php
)
[changes:protected] => Array
(
)
[casts:protected] => Array
(
)
[dates:protected] => Array
(
)
[dateFormat:protected] =>
[appends:protected] => Array
(
[0] => created_at
[1] => updated_at
)
[dispatchesEvents:protected] => Array
(
)
[observables:protected] => Array
(
)
[relations:protected] => Array
(
)
[touches:protected] => Array
(
)
[timestamps] => 1
[hidden:protected] => Array
(
)
[visible:protected] => Array
(
)
[guarded:protected] => Array
(
[0] => *
)
)
)
)
$grouped = $themeAssets->filter(function ($value) {
return Str::startsWith(explode('/', $value->asset_key)[1], 'v2');
})->mapToGroups(function ($value) {
return [explode('/', $value->asset_key)[1] => $value->asset_key];
});
print_r($grouped);
exit;

Illuminate\Support\Collection Object
(
[items:protected] => Array
(
[v2.0.20] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.0.20/migrate_settings_data.php
)
)
[v2.0.21] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.0.21/migrate_settings_data.php
)
)
[v2.0.28] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.0.28/migrate_cart.php
[1] => migrations/v2.0.28/migrate_collections.php
[2] => migrations/v2.0.28/migrate_collectiontitem.php
[3] => migrations/v2.0.28/migrate_index.php
[4] => migrations/v2.0.28/migrate_product_detail.php
[5] => migrations/v2.0.28/migrate_search.php
[6] => migrations/v2.0.28/migrate_settings_data.php
)
)
[v2.1.1] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.1/migrate_index.php
)
)
[v2.1.2] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.2/migrate_settings_data.php
)
)
[v2.1.3] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.3/migrate_cart.php
[1] => migrations/v2.1.3/migrate_collections.php
[2] => migrations/v2.1.3/migrate_collectiontitem.php
[3] => migrations/v2.1.3/migrate_index.php
[4] => migrations/v2.1.3/migrate_product_detail.php
[5] => migrations/v2.1.3/migrate_search.php
)
)
[v2.1.30] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.30/migrate_settings_data.php
)
)
[v2.1.65] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.65/migrate_product_detail.php
[1] => migrations/v2.1.65/migrate_settings_data.php
)
)
[v2.1.70] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.70/migrate_settings_data.php
)
)
[v2.1.80] => Illuminate\Database\Eloquent\Collection Object
(
[items:protected] => Array
(
[0] => migrations/v2.1.80/migrate_product_detail.php
)
)
)
)

print_r(array_keys($grouped->all()));
exit;
Array
(
[0] => v2.0.20
[1] => v2.0.21
[2] => v2.0.28
[3] => v2.1.1
[4] => v2.1.2
[5] => v2.1.3
[6] => v2.1.30
[7] => v2.1.65
[8] => v2.1.70
[9] => v2.1.80
)
PHP / Laravel / Yii2 老项目维护与长期技术支持
如果你的 PHP / Laravel / Yii2 项目已经上线,但遇到原开发离职、Bug 长期无人修复、接口不稳定、性能下降、代码难以接手等问题,可以联系我做一次远程技术排查。
适合以下情况:
✅ 老旧 PHP 系统无人维护
✅ Laravel / Yii2 项目 Bug 修复
✅ 后台管理系统小功能迭代
✅ RESTful API 接口排查
✅ MySQL / Redis / Nginx 性能问题
✅ 长期远程兼职维护
可先从一次小问题开始:
✅ 线上报错排查
✅ 接口异常分析
✅ 慢查询与性能瓶颈定位
✅ 代码结构初步评估
✅ 部署环境与日志检查
如需咨询,请联系我,并注明:PHP 维护咨询。
联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

发表回复