[更新] 时间格式
This commit is contained in:
@@ -16,7 +16,7 @@ class HomeController extends Controller
|
||||
public function index(Content $content)
|
||||
{
|
||||
|
||||
return $content->title('数据看版3')
|
||||
return $content->title('数据看版')
|
||||
->row(function (Row $row) {
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
|
||||
@@ -59,6 +59,7 @@ class IndexController extends AdminController
|
||||
|
||||
return new Table($header, $array);
|
||||
});
|
||||
|
||||
$grid->column('created_at', '提交时间');
|
||||
|
||||
$grid->column('method', '模式');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use DateTimeInterface;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Schema;
|
||||
@@ -59,4 +60,14 @@ class Log extends Model
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 为数组 / JSON 序列化准备日期。
|
||||
* @param \DateTimeInterface $date
|
||||
* @return string
|
||||
*/
|
||||
protected function serializeDate(DateTimeInterface $date)
|
||||
{
|
||||
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user