mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
Support AsCollection::of($map), AsCollection::using($class, $map) (#1714)
* Support `AsCollection::of($map)`, `AsCollection::using($class, $map)` * test compatibility(`of($map)`,`using($class, $map)` compiled), only laravel `>=12.10`
This commit is contained in:
@@ -475,7 +475,11 @@ class ModelsCommand extends Command
|
||||
}
|
||||
|
||||
if (Str::startsWith($type, AsCollection::class)) {
|
||||
$realType = $this->getTypeInModel($model, $params[0] ?? null) ?? '\Illuminate\Support\Collection';
|
||||
$realType = $this->getTypeInModel($model, $params[0] ?? null) ?: '\Illuminate\Support\Collection';
|
||||
$relatedModel = $this->getTypeInModel($model, $params[1] ?? null);
|
||||
if ($relatedModel) {
|
||||
$realType = $this->getCollectionTypeHint($realType, $relatedModel);
|
||||
}
|
||||
}
|
||||
|
||||
if (Str::startsWith($type, AsEnumCollection::class)) {
|
||||
|
||||
Reference in New Issue
Block a user