create history for webservice

This commit is contained in:
2025-11-04 15:50:08 +03:30
parent 4ba3636ce8
commit 2761f4891a
12 changed files with 171 additions and 81 deletions

View File

@@ -23,4 +23,22 @@ class Harim extends Model
get: fn($value) => json_decode($value)
);
}
public function panjarehVahedHistories(): HasMany
{
return $this->hasMany(PanjarehVahedHistory::class);
}
protected function data(): Attribute
{
return Attribute::make(
set: function ($value) {
$iv = config('harim_web_services.Harim_Info.iv');
$keyString = config('harim_web_services.Harim_Info.keyString');
$key = hash('sha256',$keyString, true);
$decrypted = openssl_decrypt($value,'aes-256-cbc',$key,false, $iv);
return json_decode($decrypted);
},
);
}
}