From a00ec0fb90466912c9379eb9fc4995a4291e37eb Mon Sep 17 00:00:00 2001 From: alex1897 Date: Wed, 3 Aug 2022 13:10:12 +0200 Subject: [PATCH] added getRouteKeyName slug --- src/Models/Quiz.php | 5 +++++ src/Models/Topic.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Models/Quiz.php b/src/Models/Quiz.php index 7c8a7de..a30cec3 100644 --- a/src/Models/Quiz.php +++ b/src/Models/Quiz.php @@ -101,4 +101,9 @@ public function quizAuthors() { return $this->hasMany(config('laravel-quiz.models.quiz_author')); } + + public function getRouteKeyName() + { + return 'slug'; + } } diff --git a/src/Models/Topic.php b/src/Models/Topic.php index 32f2c62..249f911 100644 --- a/src/Models/Topic.php +++ b/src/Models/Topic.php @@ -73,4 +73,9 @@ protected static function newFactory() { return TopicFactory::new(); } + + public function getRouteKeyName() + { + return 'slug'; + } }