Closed WalrusSoup closed 1 year ago
Running into an oddity with larastan, which reports this:
Access to an undefined property Illuminate\Database\Eloquent\Collection|Illuminate\Database\Eloquent\Model::$id.
when calling the function findBySlugOrFail
findBySlugOrFail
this function has a docblock which says it can return a collection:
@return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
however, I don't believe this is capable of returning a collection due to underlying call only returning an instance of a model or throwing:
return static::whereSlug($slug)->firstOrFail($columns);
Thanks! Fixed this and it'll go out in the next release.
Running into an oddity with larastan, which reports this:
when calling the function
findBySlugOrFail
this function has a docblock which says it can return a collection:
however, I don't believe this is capable of returning a collection due to underlying call only returning an instance of a model or throwing: