Skip to content

Commit f0d02b7

Browse files
author
Andrey Helldar
committed
Added helper for the Dumper class
1 parent dd2f545 commit f0d02b7

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
"autoload": {
2626
"psr-4": {
2727
"Helldar\\LaravelSupport\\": "src"
28-
}
28+
},
29+
"files": [
30+
"helpers/dumper.php"
31+
]
2932
},
3033
"suggest": {
3134
"symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"

helpers/dumper.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
use Helldar\LaravelSupport\Facades\Dumper;
4+
5+
if (! function_exists('dd_sql')) {
6+
/**
7+
* Dump the passed variables and end the script.
8+
*
9+
* @param \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query
10+
* @param bool $is_short
11+
* @param bool $is_return
12+
*
13+
* @return array|string
14+
*/
15+
function dd_sql($query, bool $is_short = false, bool $is_return = false)
16+
{
17+
return Dumper::ddSql($query, $is_short, $is_return);
18+
}
19+
}

0 commit comments

Comments
 (0)