PyaeSoneAungRgn / to-raw-sql
Get raw SQL from Laravel Query Builder
To Raw SQL
Get raw SQL from Laravel Query Builder
Installation
composer require pyaesoneaung/to-raw-sql
Usage
User::where('votes', '>', 100)
->orWhere(function ($query) {
$query->where('name', 'Abigail')
->where('votes', '>', 50);
})
->toRawSql();
// "select * from `users` where `votes` > 100 or (`name` = Abigail and `votes` > 50)"
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.
You can get raw SQL from Laravel Query Builder using PyaeSoneAungRgn/to-raw-sql
Top comments (0)