Open
Description
Hi,
I'm fallowing the documentation about attribute hydration and found out that either there is a bug (the method does not exist) or the documentation is wrong.
In docs there is this code example:
Hash::make('coordinates')->fillUsing(
static function ($model, $column, $value, array $validatedData) {
$model->fill([
"{$column}_longitude" = $value['long'],
"{$column}_latitude" = $value['lat'],
]);
}
);
In documentation it is not specified what namespace the class Hash
is in and the only class I found with that name was LaravelJsonApi\Core\Json\Hash. It didn't work, the method make
is undefined.
Somehow, while writing this issue, I found the class LaravelJsonApi\Eloquent\Fields\ArrayHash and tried that instead - it worked.
Please fix the documentation, replace Hash::make
with ArrayHash::make
(if I'm right about this).