[更新] 时间格式

This commit is contained in:
2021-02-01 21:49:48 +08:00
parent ea4aab991d
commit 033da12403
3 changed files with 13 additions and 1 deletions

View File

@@ -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(

View File

@@ -59,6 +59,7 @@ class IndexController extends AdminController
return new Table($header, $array);
});
$grid->column('created_at', '提交时间');
$grid->column('method', '模式');

View File

@@ -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');
}
}