From 3aacb5f87c5a5d39ab9a3a248089f41d6d5a0bc8 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Wed, 30 Nov 2016 22:08:40 +0000 Subject: [PATCH] ID detection should work better now --- app/Http/Controllers/TracksController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/TracksController.php b/app/Http/Controllers/TracksController.php index e55f447c..e5d41736 100644 --- a/app/Http/Controllers/TracksController.php +++ b/app/Http/Controllers/TracksController.php @@ -85,7 +85,7 @@ class TracksController extends Controller } $parsedUrl = parse_url($request->input('url')); - $id = preg_match('(\d+)', $parsedUrl['path']); + $id = explode('-', explode('/', $parsedUrl['path'])[2])[0]; $track = Track ::whereId($id)