morrislaptop / laravel-query-builder-dump
Adds the ability to dump the query builder inline
Installs: 35 497
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 2
Open Issues: 0
Requires (Dev)
- orchestra/testbench: ^3.5
- phpunit/phpunit: ^6.4
This package is auto-updated.
Last update: 2024-10-26 04:11:39 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" ]
This repository contains a dump method for the query builder, allowing you to dump your query inline. Similar to $collection->dump();
Installation
You can pull in the package via composer:
composer require morrislaptop/laravel-query-builder-dump --dev
The package will automatically register itself.
Usage
Simply call dump anywhere when constructing your query.
$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();
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email cr@igmorr.is instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.