Laravel with relationship but use join instead

Laravel’s with() is an easy to use query builder tool to fetch relationship. Once you’ve established the relationship in your model file you can do this. But this query has the downside of hitting the database twice, or however many relationships you query. And if you’re running it on a big scale application, it can … Read more

Laravel Compatible Scraper Libraries

What are some scraper options for Laravel? Well, Dusk works well if you’re just working in dev and testing but the following list can work for various cases. I’ve listed the four from what seems to be most reliable to least reliable depending on your use case. For instance, it seems like only panther and … Read more

Heroku H18 Error on Laravel Large File Upload

I’m experiencing Heroku’s H18 errors uploading large files and passing it to an S3 instance. It happens itermittently. The Heroku docs say the following. Usually, an H18 indicates that a response has multiple stages – forinstance, streaming chunks of a large response – and that one of thosestages has thrown an error. The docs further … Read more

Laravel Query Builder Distinct

This is a shoutout to Laravel’s Query Builder method distinct(). I feel sad and embarrassed that I didn’t know about it sooner. There are a lot of instances where I need to get a column’s unique values. And instead of using groupBy() and wasting a lot of resources. You can use distinct(), which will search … Read more