about summary refs log tree commit diff
path: root/laravel/app/Song.php
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-05-11 13:27:03 +0000
committerZach DeCook <zachdecook@librem.one>2022-05-11 13:27:03 +0000
commit6288883d88c420e242ffc07e81d9ca315eec4a5a (patch)
tree6c4cefe2e06f2036a95e72c27f1bd56539989f1e /laravel/app/Song.php
parentb5b0dc2fd788ce2e27bebb14562f2225c0078871 (diff)
downloadprosongsa-6288883d88c420e242ffc07e81d9ca315eec4a5a.tar.gz
gemini: Add feature to search by bible verse
Diffstat (limited to 'laravel/app/Song.php')
-rw-r--r--laravel/app/Song.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/laravel/app/Song.php b/laravel/app/Song.php
index 99b0aa4..6705dfa 100644
--- a/laravel/app/Song.php
+++ b/laravel/app/Song.php
@@ -12,6 +12,13 @@ class Song extends Model
     {
         return $this->belongsToMany('App\Playlist');
     }
+    public static function whereVerse($passage)
+    {
+    	$book = explode(' ',$passage)[0];
+    	$chapter = (int)explode(' ', $passage)[1];
+    	
+		return Song::where('verse', 'LIKE', "$book $chapter:%")->orWhere('verse',"$book $chapter");
+    }
     public function textTranspose($key)
     {
         $sc = new SongController();