{"repo":"spatie/laravel-sql-commenter","free":true,"listed":false,"github":"https://github.com/spatie/laravel-sql-commenter","clone":"git clone https://github.com/spatie/laravel-sql-commenter.git","description":"Add comments to SQL queries made by Laravel","language":"PHP","stars":194,"topics":["laravel","performance","php","sql"],"license":"MIT","category":"databases-storage","readme_excerpt":"Add comments to SQL queries made by Laravel This package can add comments to queries performed by Laravel. These comments will use the sqlcommenter format, which is understood by various tools and services, such as PlanetScale's Query Insights. Here's what a query looks like by default: Using this package, comments like this one will be added. The comments allow you easily pinpoint the source of the query in your codebase. Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: Optionally, you can publish the config file with: This is the content of the published config file: Usage With the package installed, comments are automatically added. By publishing the config file, you can choose which things are added to the comments. Adding arbitrary comments If you want to add other arbitrary comments to the SqlComment, you can use the addComment method. The given comment will be added to the next performed query. Dynamically enabling and disabling adding comments You can dynamically enable and disable query logging. Let's assume that you only want to add comments for a certain part in your code base. First, you would ","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-sql-commenter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}