about summary refs log tree commit diff
path: root/laravel/app/Http/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'laravel/app/Http/Controllers')
-rw-r--r--laravel/app/Http/Controllers/SongController.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/laravel/app/Http/Controllers/SongController.php b/laravel/app/Http/Controllers/SongController.php
index ba7a825..1041408 100644
--- a/laravel/app/Http/Controllers/SongController.php
+++ b/laravel/app/Http/Controllers/SongController.php
@@ -37,11 +37,20 @@ class SongController extends Controller
             }
         }
         $song['escapedText'] = $newText;
+
+
+        $params = [
+            'song' => $song,
+            'transp' => $transp,
+        ];
+
         $playlist = NULL;
-        if ( $_GET['playlist'] ?? FALSE ){
-            $playlist = Playlist::find($_GET['playlist'] ) ?? NULL;
+        if ( isset($_GET['playlist']) && $playlist = Playlist::find($_GET['playlist'] ) ){
+            $params['playlist'] = $playlist;
         }
-        return view('song', ['song' => $song, 'transp' => $transp, 'playlist' => $playlist ] );
+        $params['back'] = Song::where('id', '<', $song->id)->orderBy('id', 'desc')->first();
+        $params['next'] = Song::where('id', '>', $song->id)->orderBy('id', 'asc' )->first();
+        return view('song', $params );
     }
 
     /**