From e7ed44d7de8fdbfed2ae512dcb81777bda7ce742 Mon Sep 17 00:00:00 2001 From: Mihail-K Date: Sun, 20 Mar 2016 16:42:58 -0400 Subject: [PATCH] Clean up loose code. --- app/Commands/RemoveTrackFromPlaylistCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Commands/RemoveTrackFromPlaylistCommand.php b/app/Commands/RemoveTrackFromPlaylistCommand.php index ceac11d1..bf77af64 100644 --- a/app/Commands/RemoveTrackFromPlaylistCommand.php +++ b/app/Commands/RemoveTrackFromPlaylistCommand.php @@ -30,7 +30,7 @@ class RemoveTrackFromPlaylistCommand extends CommandBase private $_track; private $_playlist; - function __construct($playlistId, $trackId) + public function __construct($playlistId, $trackId) { $this->_playlist = Playlist::find($playlistId); $this->_track = Track::find($trackId); @@ -52,7 +52,6 @@ class RemoveTrackFromPlaylistCommand extends CommandBase */ public function execute() { -// $songIndex = $this->_playlist->tracks()->count() - 1; $this->_playlist->tracks()->detach($this->_track); Playlist::whereId($this->_playlist->id)->update([ 'track_count' => DB::raw('(SELECT COUNT(id) FROM playlist_track WHERE playlist_id = ' . $this->_playlist->id . ')')