📜  获取没有突变模型 laravel 的原始名称 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:18.257000             🧑  作者: Mango

代码示例1
Inside your model file:

1. In laravel older versions (5.x and older):
// that skips mutators
$this->getOriginal('name');

2. In laravel latest versions (6.x and above):
// that skips mutators
$model->getRawOriginal('name');

Alternative methods for getting value with mutator:
1. $this->attributes['name']
2. $this->getAttributes()['name']`