Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Laravel DB SQL HighlightingNew to Visual Studio Code? Get it now.
Laravel DB SQL Highlighting

Laravel DB SQL Highlighting

ashpowell

|
1 install
| (0) | Free
Adds SQL syntax highlighting to raw SQL strings passed to Laravel's DB facade.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Laravel DB SQL Highlighting

Adds SQL syntax highlighting to raw SQL strings passed directly to Laravel's DB facade in PHP files.

The extension is declarative: it injects VS Code's built-in SQL TextMate grammar into recognised PHP strings and does not run any extension code.

Supported calls

  • DB::select()
  • DB::selectOne()
  • DB::selectResultSets()
  • DB::scalar()
  • DB::insert()
  • DB::update()
  • DB::delete()
  • DB::statement()
  • DB::affectingStatement()
  • DB::unprepared()
  • DB::raw()

Leading namespace paths are supported, including \DB and \Illuminate\Support\Facades\DB.

Single-quoted PHP strings are also supported. PHP variables in double-quoted queries retain PHP variable highlighting.

Scope

The SQL must be a quoted string passed directly to a supported method. A lexical grammar cannot follow variables, so this form is not highlighted:

$query = 'SELECT * FROM users';
$rows = DB::select($query);

Concatenated expressions outside the initial SQL string continue to use normal PHP highlighting.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft