Laravel-Challenge-Movie-Table-Eloquent
Laravel-Challenge-Movie-Table-Eloquent copied to clipboard
Improve movie select query.
Laravel Debugbar result:
- Total queries: 1
- Models: 0
- Time: 45 ms
- Ram: 4 mb
Thank you for the challenge, really enjoyed it.
I think, that is a fast solution, but you are not using Eloquent anymore
I tried this and it doesn't seem to work on MySQL?
I think, that is a fast solution, but you are not using Eloquent anymore
Oh, I didn't notice to use eloquent only. I will update it soon.
I tried this and it doesn't seem to work on MySQL?
I am using Postgres, I will update to use eloquent only.
@ioanschmitt & @avidianity I have updated to use eloquent only.
Result:
- Queries: 2
- Models: 110
- Time: 761 ms
- Ram: 5 mb
Good, now we have to wait for the video of Povilas 😄

Yeah, it depends on the host machine. It takes less than 100 ms when I used query builder but I have changed it to use eloquent as the challenge asked.
@habibmhamadi thanks for being the first, even before the video was released so you found it directly on Github :)
And yes, the condition was Eloquent, so your solution is good, but I'll analyze what others suggested and will discuss everything in the upcoming video.