@hungerAug 31.2022 — #using the load() method on a model is meant for loading relationships on the given model, if you'd like to load an attribute/accessor such as the custom one i have below class Foo extends Model
function getCustomAttribute() { return $this->column * 5; }
you can use loadAccessors() which allows you to pass in an array of accessors/ custom attributes and will be added into the model that is returned - since custom attributes are called without the prefix of "get" and suffix of "attribute" you only need to enter the middle part of the function thanks to laravel magic $foo->loadAccessors(['custom'])
you may also be able to use setAppends() which works the same way $foo->setAppends(['custom'])
although the advantage of using loadAccessors() is that it can work through relationships, now the relationship "foo" will be loaded on the model "bar" as well as the custom attribute on the "foo" model
$bar->loadAccessors(['foo.custom'])
if you would always like to see the custom attribute loaded on the model, you can instead add the following to your model