plank / laravel-mediable

Laravel-Mediable is a package for easily uploading and attaching media files to models with Laravel
MIT License
774 stars 101 forks source link

PHPStan - Add template to MediableCollection #325

Closed TheoDVC closed 8 months ago

TheoDVC commented 1 year ago

I encountered a problem when using PHPStan / Larastan, and was able to correct it by adding the following to the MediableCollection.

I'm leaving this here for people encountering this error and for reference either in a pull request or for later.

/**
 * Collection of Mediable Models.
 * 
 * @template TKey of array-key
 * @template TModel of Model
 * @extends Collection<TKey, TModel>
 */
class MediableCollection extends Collection
{
frasmage commented 1 year ago

Indeed. You are welcome to submit a pull request to add that to the codebase for others to benefit from.

frasmage commented 8 months ago

This is implemented in the branch for the upcoming major version release.

frasmage commented 7 months ago

Version 6.0.0 has been released.