sebrave/snapshot

一个将数据库表快照渲染为HTML的包

v1.10.0 2021-05-08 06:07 UTC

This package is auto-updated.

Last update: 2024-09-10 18:11:08 UTC


README

Laravel数据库表快照包

安装

composer require sebrave/snapshot

composer update

php artisan vendor:publish --provider="SebRave\Snapshot\SnapshotServiceProvider"

设置

在 config/snapshot.php 中调整设置

用法

app('snapshot')->show(MyClass::class);

app('snapshot')->show([MyClass::class, AnotherClass::class]);

其中 MyClass::class 是一个Eloquent模型

app('snapshot')->show('mytable');

其中 mytable 是您SQL数据库中的一个表

表快照输出在根目录下

snapshot_myclass.html

快速图表

app('snapshot')->draw('mytable', 'column_x_name', 'column_y_name');

示例输出

这是一个显示 'courses' 表的数据库快照的示例

Example snapshot

这是一个比较 'courses' 表中两列的快速图表示例

Example chart