morrislaptop / laravel-query-builder-dump
添加了将查询构建器内联导出的功能
v0.2.1
2017-12-01 16:24 UTC
Requires (Dev)
- orchestra/testbench: ^3.5
- phpunit/phpunit: ^6.4
This package is auto-updated.
Last update: 2024-08-26 03:52:03 UTC
README
array:3 [ "bindings" => array:6 [ "select" => [] "join" => [] "where" => array:1 [ 0 => Illuminate\Support\Carbon {#736 +"date": "2017-11-24 15:10:26.000000" +"timezone_type": 3 +"timezone": "UTC" } ] "having" => [] "order" => [] "union" => [] ] "sql" => "select * from `prizes` where `comment_id` is null and `release_at` < ? order by `release_at` asc" "raw" => "select * from `prizes` where `comment_id` is null and `release_at` < '2017-11-24 15:10:26' order by `release_at` asc" ]
此存储库包含一个用于查询构建器的导出方法,允许您将查询内联导出。类似于 $collection->dump();
安装
您可以通过 composer 引入此包
composer require morrislaptop/laravel-query-builder-dump --dev
该包将自动注册自己。
用法
在构建查询时,只需在任何地方调用 dump 即可。
$users = DB::table('users') ->select('name', 'email as user_email') ->join('contacts', 'users.id', '=', 'contacts.user_id') ->union($first) ->dump() ->where('something', 'true') ->orWhere('name', 'John') ->orderBy('name', 'desc') ->groupBy('account_id') ->dump() ->offset(10) ->limit(5) ->having('account_id', '>', 100) ->get();
测试
$ composer test
贡献
有关详细信息,请参阅 CONTRIBUTING
安全
如果您发现任何安全相关的问题,请通过电子邮件 cr@igmorr.is 而不是使用问题跟踪器。
致谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件