Fixed error on artist pages and an issue with profile URL generation.

This commit is contained in:
Peter Deltchev 2015-12-31 21:12:16 -08:00
parent e37d7419b4
commit e85b79a9e4
3 changed files with 11 additions and 4 deletions

View file

@ -20,14 +20,13 @@
namespace Poniverse\Ponyfm\Http\Controllers\Api\Web;
use Poniverse\Ponyfm\Album;
use Poniverse\Ponyfm\Models\Album;
use Poniverse\Ponyfm\Models\Comment;
use Poniverse\Ponyfm\Models\Favourite;
use Poniverse\Ponyfm\Http\Controllers\ApiControllerBase;
use Poniverse\Ponyfm\Models\Image;
use Poniverse\Ponyfm\Models\Track;
use Poniverse\Ponyfm\Models\User;
use Cover;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Response;

View file

@ -32,6 +32,14 @@ class ArtistsController extends Controller
return View::make('artists.index');
}
public function getFavourites($slug) {
return $this->getProfile($slug);
}
public function getContent($slug) {
return $this->getProfile($slug);
}
public function getProfile($slug)
{
$user = User::whereSlug($slug)->whereNull('disabled_at')->first();

View file

@ -185,8 +185,8 @@ Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'can:access-admin-ar
Route::get('u{id}', 'ArtistsController@getShortlink')->where('id', '\d+');
Route::get('users/{id}-{slug}', 'ArtistsController@getShortlink')->where('id', '\d+');
Route::get('{slug}', 'ArtistsController@getProfile');
Route::get('{slug}/content', 'ArtistsController@getProfile');
Route::get('{slug}/favourites', 'ArtistsController@getProfile');
Route::get('{slug}/content', 'ArtistsController@getContent');
Route::get('{slug}/favourites', 'ArtistsController@getFavourites');
Route::get('/', 'HomeController@getIndex');