added php sandbox and some helper funcs to models

This commit is contained in:
2018-07-14 15:22:10 +02:00
parent 8efa08b1cc
commit 66afe052b9
16 changed files with 4764 additions and 4 deletions
+4 -4
View File
@@ -3,6 +3,7 @@
namespace MightyPork\Utils;
use Collator;
use Illuminate\Database\Events\QueryExecuted;
use MightyPork\Exceptions\ArgumentException;
use Illuminate\Log\Events\MessageLogged;
use Log;
@@ -554,10 +555,9 @@ class Utils
public static function logQueries()
{
\DB::listen(function ($query) {
Log::debug("--- Query ---");
Log::debug('SQL: ' . $query->sql);
Log::debug('Bindings: ' . json_encode($query->bindings, 128));
Log::debug("-------------");
/** @var QueryExecuted $query */
foreach ($query->bindings as $i=>$binding) $b[$i] = "'$binding'";
Log::debug('SQL: ' . preg_replace_array('/\\?/', $b, $query->sql));
});
}