Answer the question
In order to leave comments, you need to log in
Why does laravel pull the entire table when using the find() method?
Actually, I don't understand why this is happening.
Code:
Queries:
As you can see, the entire news table is also selected from the database. What for?
But when using the where() method...
...only what is needed is fetched:
The question is, why is that? And what is the best way to use? $news = News::find($id)->get()[0];
$news = News::where('id', $id)->get()[0];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question