]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7633 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 8 Jul 2025 09:39:49 +0000 (11:39 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 8 Jul 2025 09:39:49 +0000 (11:39 +0200)
app/Models/Base/ToolboxModel.php
app/Models/Traits/CheckHash.php

index b93add7b96c09b050cb0a333fbfc9ab099f92845..d5717d0399bbd1b76d249b591198feb78fb2b603 100644 (file)
@@ -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));
     }
 
index 98487fbc660a0ad364fe2da4d9a88e43c518e0f3..7dd58c027be527a57575eebf3573bb1b9551fa01 100644 (file)
@@ -10,6 +10,7 @@ trait CheckHash
     {
         if (!$this->hash) {
             $this->hash = md5(uniqid('fluidbook_hash'), false);
+            $this->saveQuietly();
         }
     }