-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hw10 - Применить кэширование #551
base: NGalkin/hw9
Are you sure you want to change the base?
Conversation
* Списк всех процедур для салона | ||
* @return Collection|null | ||
*/ | ||
public function getMyRecord(): ?Collection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше использовать getUserRecords(User $user): Collection
А Юзера брать в контроллере, потому что если вызовите команду например в консольной комманде - то получите ошибку пользователя не будет
* @param int $id | ||
* @return Collection|null | ||
*/ | ||
public function get(int $id): ?Business |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы предложил назвать метод
findCachedBusiness()
|
||
return Cache::remember($key, $ttl, function () use ($id) { | ||
$business = $this->repository->find($id); | ||
$business->procedures; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно делать
$business->load(['procedures', ...])
No description provided.