PHPackages                             sebdesign/blade-sql-formatter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sebdesign/blade-sql-formatter

ActiveLibrary[Database &amp; ORM](/categories/database)

sebdesign/blade-sql-formatter
=============================

Display formatted SQL queries in your Laravel views

v0.3.0(1y ago)82.5k↓50%1[1 PRs](https://github.com/sebdesign/blade-sql-formatter/pulls)MITPHPPHP ^8.0CI passing

Since Nov 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sebdesign/blade-sql-formatter)[ Packagist](https://packagist.org/packages/sebdesign/blade-sql-formatter)[ Docs](https://github.com/sebdesign/blade-sql-formatter)[ RSS](/packages/sebdesign-blade-sql-formatter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (14)Versions (8)Used By (0)

Display formatted SQL queries in your Laravel views
===================================================

[](#display-formatted-sql-queries-in-your-laravel-views)

[![GitHub license](https://camo.githubusercontent.com/6a2e78d76856dd0313634eb8bd0a48d0b3fcc80e37153d98b2b19e7560919c6a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73656264657369676e2f626c6164652d73716c2d666f726d6174746572)](https://github.com/sebdesign/blade-sql-formatter/blob/main/LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/c7138e10af67c8cfa95585fd658272a2a168795d5b87ee4fa2391feccf9f2017/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656264657369676e2f626c6164652d73716c2d666f726d61747465722e737667)](https://packagist.org/packages/sebdesign/blade-sql-formatter)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d2a634b5e34a57794c56b50cd0802e8b4e3791cdc33a4516048fda6f44354d84/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73656264657369676e2f626c6164652d73716c2d666f726d61747465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473)](https://github.com/sebdesign/blade-sql-formatter/actions/workflows/run-tests.yml?query=branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d7d46a59d1a7397346721b55f4afb60b427318f518479c2d9bfd408e41414c96/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73656264657369676e2f626c6164652d73716c2d666f726d61747465722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65)](https://github.com/sebdesign/blade-sql-formatter/actions/workflows/fix-php-code-style-issues.yml?query=branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/45071368d8478695d0c11b031c8aeb8dd603c8dea85cdc499ccd9640c2398331/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656264657369676e2f626c6164652d73716c2d666f726d61747465722e737667)](https://packagist.org/packages/sebdesign/blade-sql-formatter)

A small Laravel package for formatting SQL statements and files inside your Blade templates.

This package uses [`doctrine/sql-formatter`](https://github.com/doctrine/sql-formatter) to indent and add line breaks in addition to syntax highlighting.

Installation
------------

[](#installation)

> **Requires [PHP 8.1+](https://php.net/releases) and [Laravel 10+](https://laravel.com/docs/10.x/releases)**

You can install the package via composer:

```
composer require sebdesign/blade-sql-formatter
```

You can publish the config file with:

```
php artisan vendor:publish --tag="blade-sql-formatter-config"
```

This is the contents of the published config file:

```
