From b9892f8569cdd9df7975013ea587eb2c461ac06d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 8 Jul 2025 11:39:49 +0200 Subject: [PATCH] wait #7633 @0.75 --- app/Models/Base/ToolboxModel.php | 7 ++++++- app/Models/Traits/CheckHash.php | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Models/Base/ToolboxModel.php b/app/Models/Base/ToolboxModel.php index b93add7b9..d5717d039 100644 --- a/app/Models/Base/ToolboxModel.php +++ b/app/Models/Base/ToolboxModel.php @@ -11,7 +11,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; class ToolboxModel extends CubistMagicAbstractModel { use SoftDeletes; - protected static $_ownerAttribute='owner'; + + protected static $_ownerAttribute = 'owner'; use Owner; use Permissions; @@ -53,6 +54,10 @@ class ToolboxModel extends CubistMagicAbstractModel $default = ['path' => '', 'time' => time()]; $attrs = array_merge($default, $attrs); } + + if(method_exists($this,'checkHash')){ + $this->checkHash(); + } return route($routeName, array_merge(['id' => $this->id, 'hash' => $this->hash], $attrs)); } diff --git a/app/Models/Traits/CheckHash.php b/app/Models/Traits/CheckHash.php index 98487fbc6..7dd58c027 100644 --- a/app/Models/Traits/CheckHash.php +++ b/app/Models/Traits/CheckHash.php @@ -10,6 +10,7 @@ trait CheckHash { if (!$this->hash) { $this->hash = md5(uniqid('fluidbook_hash'), false); + $this->saveQuietly(); } } -- 2.39.5