FIXED - binary csat
This commit is contained in:
parent
33873729b6
commit
8c109d9719
@ -9,11 +9,21 @@ class Compressed implements CastsAttributes
|
|||||||
{
|
{
|
||||||
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
|
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||||
{
|
{
|
||||||
|
if (blank($value)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_resource($value)) {
|
||||||
|
rewind($value);
|
||||||
|
$value = stream_get_contents($value);
|
||||||
|
}
|
||||||
|
// $value = pg_unescape_bytea($value);
|
||||||
|
|
||||||
return gzinflate($value);
|
return gzinflate($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
|
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
|
||||||
{
|
{
|
||||||
return gzdeflate($value);
|
return blank($value) ? null : pg_escape_bytea(gzdeflate($value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user