我想知道如何在 CRUD 应用程序中使用VentureCraft/revisionable并获取历史记录
例如:用户每天都需要添加里程和编辑里程......在我看来(revision.blade.php)我想获取我尝试过添加和编辑但我不知道下一步该怎么做的历史?
这是模型
class Mileage extends Model
{
use \Venturecraft\Revisionable\RevisionableTrait;
protected $guarded = [];
}
这是路线
Route::get('/history', function () {
$mileage = \App\Mileage::all();
$history = $mileage->revisionHistory;
return view('revision',compact('history'));
});
我不知道用什么代码来查看????
里程有 user_id,日期,里程我想这样显示
例如:用户 ...A... 已为 ..date.. 添加里程 .. 价值为 ...mileage...
如果他们编辑我想显示像这个用户...A...更新里程...日期...值是...里程...到...里程...我怎么能做这个 ?