Closed Lelectrolux closed 6 years ago
getTweets should be moved to the Tweet model, be made static, and be renamed forUsers
getTweets
forUsers
Tweet::forUsers($users) vs $user->getTweets($users).
Tweet::forUsers($users)
$user->getTweets($users)
You would expect $user->getTweets() to return tweets belonging to the $user variable, and not need a $userIds parameter.
$user->getTweets()
$userIds
Even User::getTweets() feels like a badly named User::with('tweets').
User::getTweets()
User::with('tweets')
Anyways, at least make it static, as it doesn't have anything to do with a specific user.
Thanks.
getTweets
should be moved to the Tweet model, be made static, and be renamedforUsers
Tweet::forUsers($users)
vs$user->getTweets($users)
.You would expect
$user->getTweets()
to return tweets belonging to the $user variable, and not need a$userIds
parameter.Even
User::getTweets()
feels like a badly namedUser::with('tweets')
.Anyways, at least make it static, as it doesn't have anything to do with a specific user.