Skip to content

Black Deer Dev

Black Deer Dev
  • Home
  • About
  • Blog
  • Longform
  • Portfolio

Query Builder

Laravel Count Number of Queries to the Database

February 13, 2022December 16, 2020 by Johnnyparky

If you want to know how many times your Laravel query is hitting the database you can use this snippet by @Tarasovych from StackOverflow. Pretty handy!

Categories Blog, Uncategorized Tags Laravel, Query Builder 2 Comments

Laravel with relationship but use join instead

December 16, 2020 by Johnnyparky

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

Categories Blog Tags Laravel, Query Builder Leave a comment

Laravel Query Builder Distinct

September 17, 2020 by Johnnyparky

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

Categories Blog, Uncategorized Tags Laravel, Query Builder Leave a comment

Categories

  • Blog
  • Longform
  • Portfolio
  • Review
  • Uncategorized

About

About me

Categories

  • Blog
  • Longform
  • Portfolio
  • Review
  • Uncategorized

Tags

Active Record AI Ajax Animation Bash Browser Claude Code Composer Docker Eloquent Error Git GraphQL Heroku Home Lab Ionic Javascript Keyboard Laravel Local LLM Mac Memory Migration MySql Network Nginx Npm osx pear pecl PHP Postgres Query Builder Rails Redis Relationships Ruby S3 Scraper SQL Undergrowth Upload Validation Vue zsa
© 2026 Black Deer Dev • Built with GeneratePress