recca0120 / eloquent-dumper
Installs: 4 660
Dependents: 0
Suggesters: 0
Security: 0
Stars: 30
Watchers: 3
Forks: 1
Open Issues: 2
Requires
- ext-pdo: *
- doctrine/sql-formatter: ^1.1
- illuminate/database: ^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- mikey179/vfsstream: ^1.6
- mockery/mockery: ^1.3
- orchestra/testbench: ^3.5|^4.1|^5.2|^6.2|^7.0|^8.0|^9.0
- phpunit/phpunit: ^5.4|^6.1|^7.0|^8.0|^9.1|^10.0|^11.0
- symfony/var-dumper: ^3.2|^4.0|^5.4|^6.0|^7.0
README
Install
composer install
composer require recca0120/eloquent-dumper
publish config
php artisan vendor:publish --tag="eloquent-dumper"
Config
when you use sqlite in PHPUnit and you need MySQL version sql, you can set driver to mysql, it will output MySQL version sql
// eloquent-dumper.php return [ /* * Supported: "pdo", "mysql", "sqlite", "pgsql", "sqlsrv" */ 'driver' => env('ELOQUENT_DUMPER_GRAMMAR', 'pdo'), ];
How to use
var_dump( User::where('name', 'foo') ->where('password', 'bar') ->sql() ); User::where('name', 'foo') ->where('password', 'bar') ->dumpSql() ->get(); // output: // SELECT // * // FROM // `users` // WHERE // `name` = 'foo' AND `password` = 'bar'