Hello! There's also a problem in LikesRequest
'id' => [ "required", function ($attribute, $value, $fail) { $class = $this->getClass($value); if (! $class::where('id', $value)->exists()) { $fail($value." is not present in database"); } }, ],
this would give you an error due to getClass($value) is trying to get class of numeric id. So it should probably be like
$class = $this->getClass($this->input('likeable'));
Thanks for pointing this out. I'm fixing the article as we speak to take your feedback into account. Stay tuned!
Should be fixed now. What do you think?
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello! There's also a problem in LikesRequest
this would give you an error due to getClass($value) is trying to get class of numeric id.
So it should probably be like
Thanks for pointing this out. I'm fixing the article as we speak to take your feedback into account. Stay tuned!
Should be fixed now. What do you think?