findBySlug not supporting for eager loading #265
amiraghyan99
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
findBySlug returning Collection
but you can change function structure and return Builder
or made like this
public static function findBySlug(string $slug, array $columns = ['*'], array|string $with = [])
and than return like this
return static::where($field, $slug)->with($with)->first($columns);
Beta Was this translation helpful? Give feedback.
All reactions