]> _ Git - psq.git/commitdiff
add url to SocialArticle.php
authorLouis Jeckel <louis.jeckel@outlook.com>
Thu, 15 Oct 2020 13:45:17 +0000 (15:45 +0200)
committerLouis Jeckel <louis.jeckel@outlook.com>
Thu, 15 Oct 2020 13:45:17 +0000 (15:45 +0200)
app/Models/SocialArticle.php

index 1d44aaa252a236e1544ef658808b856245a5bceb..e395fca539ee1906d47c542bb60e720f0c7154f9 100644 (file)
@@ -66,5 +66,11 @@ class SocialArticle extends Model implements PillBoxContract
         $this->update(['count' => $this->count + 1]);
     }
 
-
+    /**
+     * @return string
+     */
+    public function getUrlAttribute(): string
+    {
+        return route('social-article.show', ['slug' => $this->slug]);
+    }
 }