Verified Commit 31cdc0c9 authored by Korko's avatar Korko
Browse files

Add key in model serialization

parent 14704991
......@@ -3,7 +3,6 @@
namespace App\Models;
use App\Casts\EncryptedString;
use Illuminate\Database\Eloquent\Model;
class DearSanta extends Model
{
......
......@@ -8,7 +8,6 @@ use DateTime;
use DB;
use exussum12\xxhash\V32 as xxHash;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Metrics;
......
......@@ -2,8 +2,6 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Exclusion extends Model
{
/**
......
......@@ -4,7 +4,6 @@ namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Bus\DispatchesJobs;
class Mail extends Model
......
<?php
namespace App\Models;
use DrawCrypt;
use Illuminate\Database\Eloquent\Model as BaseModel;
class Model extends BaseModel
{
public $key;
public function __serialize()
{
$this->key = base64_encode(DrawCrypt::getKey());
return parent::__serialize();
}
public function __unserialize(array $data)
{
$values = parent::__unserialize($data);
DrawCrypt::setKey(base64_decode($this->key));
return $values;
}
}
......@@ -6,7 +6,6 @@ use App\Casts\EncryptedString;
use App\Collections\ParticipantsCollection;
use exussum12\xxhash\V32 as xxHash;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Metrics;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment