fix last code for better answer
This commit is contained in:
@@ -34,16 +34,18 @@ class Harim extends Model
|
||||
{
|
||||
DB::transaction(function () use ($action, $description, $data) {
|
||||
$this->histories()->create([
|
||||
'expert_id' => auth()->user()->id,
|
||||
'previous_state_id' => $this->state_id,
|
||||
'previous_state_name'=> $this->state_name,
|
||||
'expert_id' => auth()->user()->id,
|
||||
'previous_state_id' => $this->state_id,
|
||||
'previous_state_name' => $this->state_name,
|
||||
'expert_description' => $description,
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
'action_id' => $action,
|
||||
'action_name' => HarimAction::name($action),
|
||||
]);
|
||||
|
||||
$this->update($data);
|
||||
});
|
||||
}
|
||||
|
||||
public function panjarehVahedHistories(): HasMany
|
||||
{
|
||||
return $this->hasMany(PanjarehVahedHistory::class);
|
||||
@@ -54,7 +56,7 @@ class Harim extends Model
|
||||
return Attribute::make(
|
||||
set: function ($value) {
|
||||
$iv = config('harim_web_services.Harim_Info.iv');
|
||||
$keyString = config('harim_web_services.Harim_Info.keyString');
|
||||
$keyString = config('harim_web_services.Harim_Info.key');
|
||||
$key = hash('sha256',$keyString, true);
|
||||
$decrypted = openssl_decrypt($value,'aes-256-cbc',$key,false, $iv);
|
||||
return json_decode($decrypted);
|
||||
|
||||
Reference in New Issue
Block a user