added php sandbox and some helper funcs to models
This commit is contained in:
@@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user