Browse Source

add getChapterPath

visuddhinanda 2 years ago
parent
commit
bfe496a7ff
1 changed files with 7 additions and 0 deletions
  1. 7 0
      app/Http/Api/PaliTextApi.php

+ 7 - 0
app/Http/Api/PaliTextApi.php

@@ -15,4 +15,11 @@ class PaliTextApi{
         $end = $para + $chapter->chapter_len -1;
         return [$start,$end];
     }
+
+    public static function getChapterPath($book,$para){
+        $path = PaliText::where('book',$book)
+                        ->where('paragraph',$para)
+                        ->value('path');
+        return $path;
+    }
 }