dd laravel query
DB::enableQueryLog(); // Enable query log
// Your Eloquent query executed by using get()
dd(DB::getQueryLog()); // Show results of log
dd laravel query
DB::enableQueryLog(); // Enable query log
// Your Eloquent query executed by using get()
dd(DB::getQueryLog()); // Show results of log
how to wirte laravel dd function in php
function d($data){
if(is_null($data)){
$str = "<i>NULL</i>";
}elseif($data == ""){
$str = "<i>Empty</i>";
}elseif(is_array($data)){
if(count($data) == 0){
$str = "<i>Empty array.</i>";
}else{
$str = "<table style=\"border-bottom:0px solid #000;\" cellpadding=\"0\" cellspacing=\"0\">";
foreach ($data as $key => $value) {
$str .= "<tr><td style=\"background-color:#008B8B; color:#FFF;border:1px solid #000;\">" . $key . "</td><td style=\"border:1px solid #000;\">" . d($value) . "</td></tr>";
}
$str .= "</table>";
}
}elseif(is_resource($data)){
while($arr = mysql_fetch_array($data)){
$data_array[] = $arr;
}
$str = d($data_array);
}elseif(is_object($data)){
$str = d(get_object_vars($data));
}elseif(is_bool($data)){
$str = "<i>" . ($data ? "True" : "False") . "</i>";
}else{
$str = $data;
$str = preg_replace("/\n/", "<br>\n", $str);
}
return $str;
}
function dnl($data){
echo d($data) . "<br>\n";
}
function dd($data){
echo dnl($data);
exit;
}
function ddt($message = ""){
echo "[" . date("Y/m/d H:i:s") . "]" . $message . "<br>\n";
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us