Attribute

Laravel Eloquent ORM Attribute

https://laravel.com/api/9.x/Illuminate/Database/Eloquent/Concerns/HasAttributes.html

vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Get original and differece of the eloquent data

$UserModel = User::find(1);

// Original data
$original_data = $UserModel->getOriginal();

// Diff data
$update_data = ['name' => 'KJ'];
$UserModel->fill($update_data);
$diff_data = $UserModel->getDirty();

// Update data
$update_meta = $UserModel->getAttributes();

Reference