byancode / eloquent-raw-sql
Print raw sql from eloquent.
dev-master
2020-08-26 17:19 UTC
Requires
- php: >=7.0
- laravel/framework: >=6.0
This package is auto-updated.
Last update: 2024-12-27 02:58:50 UTC
README
laravel model eloquent to raw sql
Getting Started
1. Install
Run the following command:
composer require byancode/eloquent-raw-sql
Byancode\EloquentRawSql\Provider::class,
2. Publish
Publish config file.
php artisan vendor:publish --provider="Byancode\EloquentRawSql\Provider"
3. Example
App\User::where('id', 41545)->orderBy('id', 'desc')->toRawSql(); # output: select * from `users` where `users`.`id` = 41545 order by `users`.`id` DESC