G
G
Gordon Freeman2019-12-06 10:47:45
Laravel
Gordon Freeman, 2019-12-06 10:47:45

How to get records with the same value in the same model?

Hey!
The question arose, how can I get records with, for example:
```
Post::where('id', '=', 'comment_id')...
```
that is, with the same values?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2019-12-06
@soloman

Post::whereRaw('id = comment_id')->get();
If so?
Or so?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question