diff --git a/src/StoredEvents/Models/EloquentStoredEvent.php b/src/StoredEvents/Models/EloquentStoredEvent.php index 48d03e5c..4dc82899 100644 --- a/src/StoredEvents/Models/EloquentStoredEvent.php +++ b/src/StoredEvents/Models/EloquentStoredEvent.php @@ -69,11 +69,17 @@ public function getMetaDataAttribute(): SchemalessAttributes return SchemalessAttributes::createForModel($this, 'meta_data'); } + /** + * @return EloquentStoredEventQueryBuilder<$this> + */ public function newEloquentBuilder($query): EloquentStoredEventQueryBuilder { return new EloquentStoredEventQueryBuilder($query); } + /** + * @return EloquentStoredEventCollection<$this> + */ public function newCollection(array $models = []): EloquentStoredEventCollection { return new EloquentStoredEventCollection($models); diff --git a/src/StoredEvents/Models/EloquentStoredEventCollection.php b/src/StoredEvents/Models/EloquentStoredEventCollection.php index 37cc999d..a0813752 100644 --- a/src/StoredEvents/Models/EloquentStoredEventCollection.php +++ b/src/StoredEvents/Models/EloquentStoredEventCollection.php @@ -5,6 +5,11 @@ use Illuminate\Database\Eloquent\Collection as EloquentCollection; use Illuminate\Support\Collection; +/** + * @template TEloquentStoredEvent of EloquentStoredEvent + * + * @extends EloquentCollection + */ class EloquentStoredEventCollection extends EloquentCollection { /** diff --git a/src/StoredEvents/Models/EloquentStoredEventQueryBuilder.php b/src/StoredEvents/Models/EloquentStoredEventQueryBuilder.php index 35c6ddd1..2e568882 100644 --- a/src/StoredEvents/Models/EloquentStoredEventQueryBuilder.php +++ b/src/StoredEvents/Models/EloquentStoredEventQueryBuilder.php @@ -6,7 +6,11 @@ use Spatie\EventSourcing\StoredEvents\StoredEvent; /** - * @method \Spatie\EventSourcing\StoredEvents\Models\EloquentStoredEventCollection get + * @template TEloquentStoredEvent of EloquentStoredEvent + * + * @method \Spatie\EventSourcing\StoredEvents\Models\EloquentStoredEventCollection get() + * + * @extends Builder */ class EloquentStoredEventQueryBuilder extends Builder {