From 85627b93a3f94416a6722eb948579c5f82792c48 Mon Sep 17 00:00:00 2001 From: Louis Jeckel Date: Thu, 15 Oct 2020 15:45:17 +0200 Subject: [PATCH] add url to SocialArticle.php --- app/Models/SocialArticle.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Models/SocialArticle.php b/app/Models/SocialArticle.php index 1d44aaa..e395fca 100644 --- a/app/Models/SocialArticle.php +++ b/app/Models/SocialArticle.php @@ -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]); + } } -- 2.39.5