Pony.fm/routes/web.php

257 lines
13 KiB
PHP
Raw Normal View History

2015-08-30 13:22:00 +02:00
<?php
/**
* Pony.fm - A community for pony fan music.
* Copyright (C) 2015-2017 Feld0.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2015-08-30 13:22:00 +02:00
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
2015-09-05 16:59:36 +02:00
Route::get('/dashboard', 'TracksController@getIndex');
Route::get('/tracks', ['as' => 'tracks.discover', 'uses' => 'TracksController@getIndex']);
2015-09-05 16:59:36 +02:00
Route::get('/tracks/popular', 'TracksController@getIndex');
Route::get('/tracks/random', 'TracksController@getIndex');
Route::get('tracks/{id}-{slug}', 'TracksController@getTrack');
Route::get('tracks/{id}-{slug}/edit', 'TracksController@getEdit');
Route::get('tracks/{id}-{slug}/stats', 'StatsController@getIndex');
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::get('t{id}', 'TracksController@getShortlink')->where('id', '\d+');
Route::get('t{id}/embed', 'TracksController@getEmbed');
Route::get('t{id}/stream.{extension}', 'TracksController@getStream');
Route::get('t{id}/dl.{extension}', 'TracksController@getDownload');
2015-09-05 16:59:36 +02:00
Route::get('albums', 'AlbumsController@getIndex');
Route::get('albums/{id}-{slug}', 'AlbumsController@getShow');
Route::get('a{id}', 'AlbumsController@getShortlink')->where('id', '\d+');
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::get('a{id}/dl.{extension}', 'AlbumsController@getDownload');
2015-09-05 16:59:36 +02:00
Route::get('artists', 'ArtistsController@getIndex');
Route::get('playlists', 'PlaylistsController@getIndex');
Route::get('/register', 'AccountController@getRegister');
Route::get('/login', 'AuthController@getLogin');
Route::post('/auth/logout', 'AuthController@postLogout');
2015-09-05 16:59:36 +02:00
Route::get('/auth/oauth', 'AuthController@getOAuth');
Route::post('/auth/poniverse-sync', 'AuthController@postPoniverseAccountSync')->middleware('throttle:60,1');
2015-09-05 16:59:36 +02:00
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::get('/about', function () {
return View::make('pages.about');
});
Route::get('/faq', function () {
return View::make('pages.faq');
});
Route::get('/mlpforums-advertising-program', function () {
return View::make('pages.mlpforums-advertising-program');
});
2015-09-05 16:59:36 +02:00
2016-11-21 01:42:43 +01:00
Route::get('/hwc2016-rules', function () {
return View::make('pages.hwc-terms');
});
2015-12-27 10:43:43 +01:00
Route::get('i{id}/{type}.{extension}', 'ImagesController@getImage')->where('id', '\d+');
2015-09-05 16:59:36 +02:00
Route::get('playlist/{id}-{slug}', 'PlaylistsController@getPlaylist');
Route::get('p{id}', 'PlaylistsController@getShortlink')->where('id', '\d+');
Route::get('p{id}/dl.{extension}', 'PlaylistsController@getDownload');
2015-09-05 16:59:36 +02:00
2016-05-27 21:38:59 +02:00
Route::get('notifications', 'AccountController@getNotifications');
Route::group(['prefix' => 'notifications/email'], function () {
Route::get('/unsubscribe/{subscriptionKey}', 'NotificationsController@getEmailUnsubscribe')->name('email:unsubscribe');
Route::get('/unsubscribed', 'NotificationsController@getEmailUnsubscribePage')->name('email:confirm-unsubscribed');
Route::get('/click/{emailKey}', 'NotificationsController@getEmailClick')->name('email:click');
});
2016-11-30 22:42:45 +01:00
Route::get('oembed', 'TracksController@getOembed');
2015-11-09 20:35:30 +01:00
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['prefix' => 'api/v1', 'middleware' => 'json-exceptions'], function () {
Route::get('/tracks/radio-details/{hash}', 'Api\V1\TracksController@getTrackRadioDetails');
2015-09-05 16:59:36 +02:00
Route::post('/tracks/radio-details/{hash}', 'Api\V1\TracksController@getTrackRadioDetails');
Route::get('/tracks/{id}', 'Api\V1\TracksController@getTrackDetails')->where('id', '\d+');
2015-11-09 20:35:30 +01:00
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['middleware' => 'auth.oauth:ponyfm:tracks:upload'], function () {
2015-11-09 20:35:30 +01:00
Route::post('tracks', 'Api\V1\TracksController@postUploadTrack');
Route::get('/tracks/{id}/upload-status', 'Api\V1\TracksController@getUploadStatus');
2015-11-09 20:35:30 +01:00
});
2015-09-05 16:59:36 +02:00
});
2017-01-02 20:56:17 +01:00
Route::group(['prefix' => 'api/web', 'middleware' => 'cors'], function () {
2016-09-30 03:36:44 +02:00
Route::post('/alexa', 'Api\Web\AlexaController@handle');
2015-09-05 16:59:36 +02:00
Route::get('/taxonomies/all', 'Api\Web\TaxonomiesController@getAll');
2016-01-21 04:18:18 +01:00
Route::get('/search', 'Api\Web\SearchController@getSearch');
2015-09-05 16:59:36 +02:00
Route::get('/tracks', 'Api\Web\TracksController@getIndex');
Route::get('/tracks/{id}', 'Api\Web\TracksController@getShow')->where('id', '\d+');
Route::get('/tracks/cached/{id}/{format}', 'Api\Web\TracksController@getCachedTrack')->where(['id' => '\d+', 'format' => '.+']);
2016-05-03 14:01:50 +02:00
Route::get('/tracks/{id}/stats', 'Api\Web\StatsController@getTrackStats')->where('id', '\d+');
2015-09-05 16:59:36 +02:00
Route::get('/albums', 'Api\Web\AlbumsController@getIndex');
Route::get('/albums/{id}', 'Api\Web\AlbumsController@getShow')->where('id', '\d+');
Route::get('/albums/cached/{id}/{format}', 'Api\Web\AlbumsController@getCachedAlbum')->where(['id' => '\d+', 'format' => '.+']);
2015-09-05 16:59:36 +02:00
Route::get('/playlists', 'Api\Web\PlaylistsController@getIndex');
2016-01-07 19:16:37 +01:00
Route::get('/playlists/show/{id}', 'Api\Web\PlaylistsController@getShow');
2015-09-05 16:59:36 +02:00
Route::get('/playlists/{id}', 'Api\Web\PlaylistsController@getShow')->where('id', '\d+');
Route::get('/playlists/cached/{id}/{format}', 'Api\Web\PlaylistsController@getCachedPlaylist')->where(['id' => '\d+', 'format' => '.+']);
2015-09-05 16:59:36 +02:00
Route::get('/comments/{type}/{id}', 'Api\Web\CommentsController@getIndex')->where('id', '\d+');
Route::get('/artists', 'Api\Web\ArtistsController@getIndex');
Route::post('/artists', 'Api\Web\ArtistsController@postIndex');
2015-09-05 16:59:36 +02:00
Route::get('/artists/{slug}', 'Api\Web\ArtistsController@getShow');
Route::get('/artists/{slug}/content', 'Api\Web\ArtistsController@getContent');
Route::get('/artists/{slug}/favourites', 'Api\Web\ArtistsController@getFavourites');
Route::get('/dashboard', 'Api\Web\DashboardController@getIndex');
2016-11-11 20:39:31 +01:00
Route::get('/announcements', 'Api\Web\AnnouncementsController@getIndex');
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['middleware' => 'auth'], function () {
2015-09-05 16:59:36 +02:00
Route::post('/tracks/upload', 'Api\Web\TracksController@postUpload');
Route::get('/tracks/{id}/upload-status', 'Api\Web\TracksController@getUploadStatus');
2015-09-05 16:59:36 +02:00
Route::post('/tracks/delete/{id}', 'Api\Web\TracksController@postDelete');
Route::post('/tracks/edit/{id}', 'Api\Web\TracksController@postEdit');
Route::post('/tracks/{id}/version-upload', 'Api\Web\TracksController@postUploadNewVersion');
Route::get('/tracks/{id}/version-change/{version}', 'Api\Web\TracksController@getChangeVersion');
Route::get('/tracks/{id}/version-upload-status', 'Api\Web\TracksController@getVersionUploadStatus');
Route::get('/tracks/{id}/versions', 'Api\Web\TracksController@getVersionList');
2015-09-05 16:59:36 +02:00
Route::post('/albums/create', 'Api\Web\AlbumsController@postCreate');
Route::post('/albums/delete/{id}', 'Api\Web\AlbumsController@postDelete');
Route::post('/albums/edit/{id}', 'Api\Web\AlbumsController@postEdit');
Route::post('/playlists/create', 'Api\Web\PlaylistsController@postCreate');
Route::post('/playlists/delete/{id}', 'Api\Web\PlaylistsController@postDelete');
Route::post('/playlists/edit/{id}', 'Api\Web\PlaylistsController@postEdit');
Route::post('/playlists/{id}/add-track', 'Api\Web\PlaylistsController@postAddTrack');
Route::post('/playlists/{id}/remove-track', 'Api\Web\PlaylistsController@postRemoveTrack');
2015-09-05 16:59:36 +02:00
Route::post('/comments/{type}/{id}', 'Api\Web\CommentsController@postCreate')->where('id', '\d+');
Route::post('/account/settings/save/{userSlug}', 'Api\Web\AccountController@postSave');
2015-09-05 16:59:36 +02:00
Route::post('/favourites/toggle', 'Api\Web\FavouritesController@postToggle');
Route::post('/follow/toggle', 'Api\Web\FollowController@postToggle');
Route::post('/dashboard/read-news', 'Api\Web\DashboardController@postReadNews');
2016-05-17 01:30:05 +02:00
Route::get('/account/settings/{slug}', 'Api\Web\AccountController@getSettings');
2016-06-10 03:19:16 +02:00
Route::get('/notifications', 'Api\Web\NotificationsController@getNotifications');
Route::put('/notifications/mark-as-read', 'Api\Web\NotificationsController@putMarkAsRead');
2016-06-10 03:19:16 +02:00
Route::post('/notifications/subscribe', 'Api\Web\NotificationsController@postSubscribe');
Route::post('/notifications/unsubscribe', 'Api\Web\NotificationsController@postUnsubscribe');
2015-09-05 16:59:36 +02:00
Route::get('/tracks/edit/{id}', 'Api\Web\TracksController@getEdit');
2016-06-06 08:15:56 +02:00
Route::get('/users/{userId}', 'Api\Web\AccountController@getUser')->where('userId', '\d+');
Route::get('/users/{userId}/tracks', 'Api\Web\TracksController@getOwned')->where('userId', '\d+');
Route::get('/users/{userSlug}/tracks', 'Api\Web\TracksController@getOwned');
Route::get('/users/{userId}/albums', 'Api\Web\AlbumsController@getOwned')->where('userId', '\d+');
Route::get('/users/{userSlug}/albums', 'Api\Web\AlbumsController@getOwned');
Route::get('/users/{userId}/images', 'Api\Web\ImagesController@getOwned')->where('userId', '\d+');
Route::get('/users/{userSlug}/images', 'Api\Web\ImagesController@getOwned');
Route::get('/users/{userId}/playlists', 'Api\Web\PlaylistsController@getOwned')->where('userId', '\d+');
Route::get('/users/{userSlug}/playlists', 'Api\Web\PlaylistsController@getOwned');
2015-09-05 16:59:36 +02:00
Route::get('/albums/edit/{id}', 'Api\Web\AlbumsController@getEdit');
Route::get('/playlists/pinned', 'Api\Web\PlaylistsController@getPinned');
Route::get('/favourites/tracks', 'Api\Web\FavouritesController@getTracks');
Route::get('/favourites/albums', 'Api\Web\FavouritesController@getAlbums');
Route::get('/favourites/playlists', 'Api\Web\FavouritesController@getPlaylists');
});
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'can:access-admin-area']], function () {
Route::get('/genres', 'Api\Web\GenresController@getIndex');
2016-01-06 13:50:44 +01:00
Route::post('/genres', 'Api\Web\GenresController@postCreate');
Route::put('/genres/{id}', 'Api\Web\GenresController@putRename')->where('id', '\d+');
Route::delete('/genres/{id}', 'Api\Web\GenresController@deleteGenre')->where('id', '\d+');
2016-05-11 18:41:49 +02:00
2016-06-06 01:12:04 +02:00
Route::get('/showsongs', 'Api\Web\ShowSongsController@getIndex');
Route::post('/showsongs', 'Api\Web\ShowSongsController@postCreate');
Route::put('/showsongs/{id}', 'Api\Web\ShowSongsController@putRename')->where('id', '\d+');
Route::delete('/showsongs/{id}', 'Api\Web\ShowSongsController@deleteSong')->where('id', '\d+');
2016-05-11 18:41:49 +02:00
Route::get('/tracks', 'Api\Web\TracksController@getAllTracks');
Route::get('/tracks/unclassified', 'Api\Web\TracksController@getClassifierQueue');
2016-11-12 22:57:29 +01:00
Route::get('/announcements', 'Api\Web\AnnouncementsController@getAdminIndex');
Route::get('/announcements/{id}', 'Api\Web\AnnouncementsController@getItemById')->where('id', '\d+');
Route::post('/announcements', 'Api\Web\AnnouncementsController@postCreate');
Route::put('/announcements/{id}', 'Api\Web\AnnouncementsController@putUpdate')->where('id', '\d+');
Route::delete('/announcements/{id}', 'Api\Web\AnnouncementsController@deleteItem')->where('id', '\d+');
});
2017-01-02 04:33:21 +01:00
Route::get('/auth/current', 'Api\Web\AccountController@getCurrentUser');
Route::post('/auth/logout', 'Api\Web\AuthController@postLogout');
2015-09-05 16:59:36 +02:00
});
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'can:access-admin-area']], function () {
Route::get('/genres', 'AdminController@getGenres');
2016-05-11 18:41:49 +02:00
Route::get('/tracks', 'AdminController@getTracks');
Route::get('/tracks/unclassified', 'AdminController@getClassifierQueue');
2016-06-06 01:12:04 +02:00
Route::get('/show-songs', 'AdminController@getShowSongs');
Route::get('/users', 'AdminController@getUsers');
2016-11-12 22:57:29 +01:00
Route::get('/announcements', 'AdminController@getAnnouncements');
Route::get('/', 'AdminController@getIndex');
});
2015-09-05 16:59:36 +02:00
Route::get('u{id}', 'ArtistsController@getShortlink')->where('id', '\d+');
Route::get('users/{id}-{slug}', 'ArtistsController@getShortlink')->where('id', '\d+');
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['prefix' => '{slug}'], function () {
Route::get('/', 'ArtistsController@getProfile');
Route::get('/content', 'ArtistsController@getContent');
Route::get('/favourites', 'ArtistsController@getFavourites');
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['prefix' => 'account', 'middleware' => 'auth'], function () {
Route::get('/tracks', 'ContentController@getTracks');
Route::get('/tracks/edit/{id}', 'ContentController@getTracks');
Route::get('/albums', 'ContentController@getAlbums');
Route::get('/albums/edit/{id}', 'ContentController@getAlbums');
Route::get('/albums/create', 'ContentController@getAlbums');
Route::get('/playlists', 'ContentController@getPlaylists');
Route::get('/uploader', 'UploaderController@getIndex');
Route::get('/', 'AccountController@getIndex')->name('account:settings');
});
});
2015-09-05 16:59:36 +02:00
Route::get('/', 'HomeController@getIndex');
Laravel 5.2 Update (#106) * Adopt PSR-2 coding style The Laravel framework adopts the PSR-2 coding style in version 5.1. Laravel apps *should* adopt this coding style as well. Read the [PSR-2 coding style guide][1] for more details and check out [PHPCS][2] to use as a code formatting tool. [1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md [2]: https://github.com/squizlabs/PHP_CodeSniffer * Adopt PHP short array syntax Laravel 5 adopted the short array syntax which became available in PHP 5.4. * Remove SelfHandling from Jobs Jobs are self handling by default in Laravel 5.2. * Add new exceptions to `$dontReport` property * Shift core files * Shift Middleware Laravel 5.2 adjusts the `Guard` object used within middleware. In addition, new `can` and `throttles` middleware were added. * Shift Input to Request facade Laravel 5.2 no longer registers the `Input` facade by default. Laravel now prefers using the `Request` facade or the `$request` object within *Controllers* instead. Review the [HTTP Requests][1] documentation for more details. [1]: https://laravel.com/docs/5.2/requests * Shift configuration Laravel 5.2 introduces the `env` app configuration option and removes the `pretend` mail configuration option. In addition, a few of the default `providers` and `aliases` bindings were removed. * Shift Laravel dependencies * Shift cleanup * Updated composer.lock * Updated Middleware to 5.2 * Config update for Laravel 5.2 * [Laravel 5.2] Updated validation strings * Updated auth config * Updated to use middleware groups * Added laravel 5.2 sessions migration
2016-09-30 00:26:31 +02:00
Route::group(['domain' => 'api.pony.fm'], function () {
2015-09-05 16:59:36 +02:00
Route::get('tracks/latest', ['uses' => 'Api\Mobile\TracksController@latest']);
Route::get('tracks/popular', ['uses' => 'Api\Mobile\TracksController@popular']);
});