From 653a6c4db19efbbd72c39e7723b06d6ce8291f1a Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Tue, 10 Jan 2023 13:00:40 +0000 Subject: Song: Fix searching for "Psalms" => "Psalm" --- laravel/app/Song.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'laravel/app') diff --git a/laravel/app/Song.php b/laravel/app/Song.php index e2f2589..c4722a2 100644 --- a/laravel/app/Song.php +++ b/laravel/app/Song.php @@ -18,10 +18,8 @@ class Song extends Model $parser = new BiblePassageParser(); // Can throw an exception. $refs = $parser->parse($passage); - $book = (string)($refs[0]->from()->book()); - $chapter = $refs[0]->from()->chapter(); - - return Song::where('verse', 'LIKE', "$book $chapter:%")->orWhere('verse',"$book $chapter")->orWhere('verse', 'LIKE', "%; $book $chapter:%"); + $bc = explode(':', $refs[0])[0]; + return Song::where('verse', 'LIKE', "$bc:%")->orWhere('verse',"$bc")->orWhere('verse','like',$refs[0].";%")->orWhere('verse', 'LIKE', "%; $bc:%"); } public function textTranspose($key) { -- cgit 1.4.1