Files
rkm-conectasus-ci-sandbox/api/bootstrap/helpers_functions.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

37 lines
841 B
PHP

<?php
if (!function_exists('dd')) {
function dd(...$vars)
{
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: *');
header('Access-Control-Allow-Headers: *');
http_response_code(500);
foreach ($vars as $v) {
\Symfony\Component\VarDumper\VarDumper::dump($v);
}
exit(1);
}
}
if (!function_exists('getSql')) {
function getSql($query, $withBindings = true)
{
if ($withBindings) {
return vsprintf(
str_replace('?', '%s', $query->toSql()),
collect($query->getBindings())->map(function ($binding) {
return is_numeric($binding) ? $binding : "'{$binding}'";
})->toArray()
);
}
return $query->toSql();
}
}