routes.php 13.4 KB
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Lumen the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

/**
 * Home.
 */
$router->get('/', ['as' => 'home', 'uses' => 'HomeController@index']);

/**
 * Log in & Log out.
 */
$router->get('/login', ['as' => 'showLogin', 'uses' => 'AuthController@showLogin']);
$router->post('/login', ['as' => 'login', 'uses' => 'AuthController@login']);
$router->post('/fblogin', ['as' => 'fblogin', 'uses' => 'AuthController@facebookLogin']);
$router->post('/logout', ['as' => 'logout', 'uses' => 'AuthController@logout']);

/**
 * Registration.
 */
$router->get('/signup', ['as' => 'registration', 'uses' => 'RegistrationController@signupForm']);
$router->post('/signup', ['uses' => 'RegistrationController@register']);
$router->get('/signup/request-activation', ['uses' => 'RegistrationController@requestActivation']);
$router->post('/signup/resend-activation', ['uses' => 'RegistrationController@resendActivation']);
$router->get('/signup/activation-sent', ['uses' => 'RegistrationController@activationSent']);
$router->get('/signup/check-username', ['uses' => 'RegistrationController@checkUsername']);
$router->get('/signup/done', ['uses' => 'RegistrationController@done']);
$router->get('/signup/confirm', ['uses' => 'RegistrationController@confirm']);

/**
 * Suggestions.
 */
$router->get('/suggest/team', ['uses' => 'SuggestionController@team']);

/**
 * Search.
 */
$router->get('/search-disabled', ['as' => 'search', 'uses' => 'SearchController@index']);
$router->post('/search.json', ['uses' => 'SearchController@search']);

/**
 * Posts.
 */
$router->get('/posts-pagelet', ['uses' => 'PostController@postsPagelet']);
$router->post('/views/{objectRef}', ['uses' => 'ViewCounterController@recordPageView']);

/**
 * Password reset and account recovery.
 */
$router->get('/profile/request-password-reset', ['uses' => 'AuthController@passwordResetRequest']);
$router->post('/profile/request-password-reset', ['uses' => 'AuthController@requestPasswordReset']);
$router->get('/profile/reset-password', ['uses' => 'AuthController@showResetPassword']);
$router->post('/profile/reset-password', ['uses' => 'AuthController@resetPassword']);
$router->get('/profile/password-reset-done', ['uses' => 'AuthController@passwordResetDone']);

/**
 * Profile settings.
 */
$router->get('/profile/settings', ['as' => 'profileSettings', 'uses' => 'ProfileController@settings']);
$router->post('/profile/settings', ['uses' => 'ProfileController@updateSettings']);
$router->post('/profile/settings/upload-avatar', ['uses' => 'ProfileController@uploadAvatar']);
$router->post('/profile/settings/fbconnect', ['uses' => 'ProfileController@fbConnect']);
$router->post('/profile/settings/fbdisconnect', ['uses' => 'ProfileController@fbDisconnect']);
$router->post('/profile/settings/set-timezone', ['uses' => 'ProfileController@setTimezone']);
$router->post('/profile/settings/no-spoilers', ['uses' => 'ProfileController@noSpoilers']);

/**
 * Profile Wall.
 */
$router->get('/profile/{username}/wall', ['as' => 'profileWall', 'uses' => 'ProfileController@wall']);
$router->post('/profile/wall/comments', ['uses' => 'ProfileController@storeWallComment']);
$router->put('/profile/wall/comments/{commentId:\d+}', ['uses' => 'ProfileController@editWallComment']);

/**
 * Profile Friends.
 */
$router->get('/profile/{username}/friends', ['as' => 'profileFriends', 'uses' => 'ProfileController@friends']);
$router->get('/profile/{username}/friends.json', ['uses' => 'ProfileController@friendsJson']);
$router->post('/profile/friends/unfriend', ['uses' => 'ProfileController@unfriend']);
$router->post('/profile/friends/request', ['uses' => 'ProfileController@friendRequest']);
$router->post('/profile/friends/accept-request', ['uses' => 'ProfileController@acceptFriendRequest']);
$router->post('/profile/friends/delete-request', ['uses' => 'ProfileController@deleteFriendRequest']);

/**
 * Rewrite old profile URLs.
 */
$router->get('/profile', ['uses' => 'CatchOldUrlController@profile']);
$router->get('/profile/wall', ['uses' => 'CatchOldUrlController@profileWall']);
$router->get('/profile/friends', ['uses' => 'CatchOldUrlController@profileFriends']);

/**
 * Profile.
 */
$router->get('/profile/replies', ['as' => 'profileReplies', 'uses' => 'ProfileController@replies']);
$router->get('/profile/{username}', ['as' => 'profile', 'uses' => 'ProfileController@profile']);

/**
 * Bans.
 */
$router->post('/bans', ['uses' => 'BanController@store']);
$router->post('/bans/request-permaban', ['uses' => 'BanController@requestPermaban']);
$router->get('/bans/overview', ['as' => 'bansOverview', 'uses' => 'BanController@overview']);
$router->get('/bans.json', ['uses' => 'BanController@bans']);
$router->get('/bans/summaries.json', ['uses' => 'BanController@summaries']);
$router->get('/bans/active', ['uses' => 'BanController@active']);
$router->get('/bans/active-pagelet', ['uses' => 'BanController@activePagelet']);

 /**
  * Puppets.
  */
 $router->get('/puppets', ['uses' => 'ModeratorController@puppets']);
 $router->get('/puppets.json', ['uses' => 'ModeratorController@puppetsJson']);

/**
 * Previews.
 */
$router->get('/previews', ['as' => 'previews', 'uses' => 'PreviewController@index']);
$router->get('/matches/{id:\d+}/{slug}/preview', ['as' => 'matchPreview', 'uses' => 'PreviewController@show']);

/**
 * Matches.
 */
$router->get('/matches/{id:\d+}/{slug}/review', ['as' => 'matchReview', 'uses' => 'MatchController@review']);
$router->get('/matches.json', ['uses' => 'MatchController@matchesJson']);
$router->post('/matches/comment', ['uses' => 'MatchController@comment']);
$router->put('/matches/comment/{commentId:\d+}', ['uses' => 'CommentController@edit']);

/**
 * Lemix.
 */
$router->get('/lemix', ['as' => 'lemix', 'uses' => 'LemixController@index']);
$router->get('/lemix/{slug}-{id:\d+}', ['as' => 'lemixPost', 'uses' => 'LemixController@post']);
$router->get('/lemix/posts-pagelet', ['uses' => 'LemixController@postsPagelet']);

/**
 * Legendary.
 */
$router->get('/legendary', ['as' => 'legendary', 'uses' => 'LegendaryController@index']);

/**
 * Hall Of Fame.
 */
$router->get('/hall-of-fame', ['as' => 'hallOfFame', 'uses' => 'HoFController@index']);
$router->get('/hall-of-fame/{decade:[0-9]{4}}-{to:[0-9]{4}}', ['uses' => 'HoFController@decade']);
$router->get('/hall-of-fame/{playerSlug}', ['uses' => 'HoFController@showPost']);

/**
 * Transfer Center.
 */
$router->get('/transfer-center', ['as' => 'transferCenter', 'uses' => 'TransferCenterController@index']);
$router->get('/transfer-center/deadline-day-live', ['uses' => 'TransferCenterController@deadlineDay']);

/**
 * Talk.
 */
$router->get('/talk', ['as' => 'talk', 'uses' => 'TalkController@index']);

/**
 * News.
 */
$router->get('/news', ['as' => 'news', 'uses' => 'NewsController@index']);
$router->get('/news/posts-pagelet', ['uses' => 'NewsController@postsPagelet']);

/**
 * Competitions.
 */
$router->get('/competitions/{id:\d+}/{slug}', ['as' => 'competition', 'uses' => 'CompetitionController@index']);

/**
 * Votes.
 */
$router->post('/vote', ['as' => 'vote', 'uses' => 'VoteController@vote']);
$router->post('/vote-score', ['as' => 'voteScore', 'uses' => 'VoteController@voteScore']);
$router->post('/vote-poll', ['as' => 'voteScore', 'uses' => 'VoteController@votePoll']);
$router->get('/vote/votes.json', ['uses' => 'VoteController@votes']);

/**
 * Comments.
 */
$router->get('/comments-pagelet', ['uses' => 'CommentController@commentsPagelet']);
$router->get('/comments/{commentId:\d+}/parent-pagelet', ['uses' => 'CommentController@parentCommentPagelet']);
$router->get('/comments/{commentId:\d+}', ['uses' => 'CommentController@getComment']);
$router->post('/comments', ['uses' => 'CommentController@comment']);
$router->put('/comments/{commentId:\d+}', ['uses' => 'CommentController@edit']);
$router->post('/comments/{commentId:\d+}/approval', ['uses' => 'CommentController@changeApproval']);
$router->post('/comments/{commentId:\d+}/vote', ['uses' => 'CommentController@vote']);
$router->post('/comments/upload-image', ['uses' => 'CommentController@uploadImage']);
$router->post('/comments/{commentId:\d+}/flag', ['uses' => 'FlagsController@flagComment']);

/**
 * Flags.
 */
$router->get('/flags/review', ['as' => 'flagsReview', 'uses' => 'FlagsController@review']);
$router->post('/flags/clear', ['uses' => 'FlagsController@clear']);

/**
 * Forums.
 */
$router->get('/forum', ['as' => 'forum', 'uses' => 'ForumController@index']);
$router->get('/forum/discussions/{slug}-{id:\d+}', ['as' => 'forumPost', 'uses' => 'ForumController@showPost']);
$router->post('/forum/comments', ['uses' => 'ForumController@comment']);
$router->put('/forum/comments/{commentId:\d+}', ['uses' => 'ForumController@editComment']);
$router->post('/forum/discussions', ['uses' => 'ForumController@store']);
$router->post('/forum/discussions/{postId:\d+}/status', ['uses' => 'ForumController@editStatus']);
$router->post('/forum/discussions/{postId:\d+}/settings', ['uses' => 'ForumController@editSettings']);
$router->get('/forum/{categorySlug}', ['as' => 'forumCategory', 'uses' => 'ForumController@index']);
$router->post('/forum/discussions/{id:\d+}/count-view', ['uses' => 'ForumController@recordPageView']);

/**
 * Subscription.
 */
$router->post('/subscriptions/follow', ['uses' => 'SubscriptionController@follow']);
$router->post('/subscriptions/ignore', ['uses' => 'SubscriptionController@ignore']);

/**
 * Other/static pages.
 */
$router->get('/dmca', ['as' => 'dmca', 'uses' => 'ContactController@dmca']);
$router->get('/advertise', ['as' => 'advertise', 'uses' => 'AdvertiseController@index']);
$router->get('/advertise/ad-tester', ['uses' => 'AdvertiseController@adTester']);
$router->get('/feedback', ['as' => 'feedback', 'uses' => 'ContactController@feedback']);
$router->post('/feedback/send-mail', ['uses' => 'ContactController@submitFeedback']);

/**
 * Predictor.
 */
$router->get('/predictor/matches.json', 'PredictorController@matches');
$router->get('/predictor/player.json', 'PredictorController@player');
$router->get('/predictor/rounds.json', 'PredictorController@rounds');
$router->get('/predictor/leaderboard.json', 'PredictorController@leaderboard');
$router->post('/predictor/predict', ['uses' => 'PredictorController@predict']);
$router->get('/predictor[/{any:.*}]', ['uses' => 'PredictorController@index']);

/**
 * Tips.
 */
$router->get('/tips', 'TipController@index');
$router->get('/tips/{id}.json', 'TipController@tipJson');
$router->post('/tips', 'TipController@store');
$router->put('/tips/{id}', 'TipController@update');
$router->delete('/tips/{id}', 'TipController@delete');

/**
 * Embed.
 */
$router->get('/embed', 'EmbedController@index');
$router->get('/oembed', 'EmbedController@oembed');

/**
 * Polls.
 */
$router->get('/polls/{pollId}', ['uses' => 'PollController@getPoll']);
$router->post('/polls', ['uses' => 'PollController@store']);
$router->put('/polls/{pollId}', ['uses' => 'PollController@edit']);

/**
 * Articles.
 */
$router->get('/articles/create', ['uses' => 'ArticleController@create']);
$router->get('/articles/{id}/edit', ['as' => 'editArticle', 'uses' => 'ArticleController@edit']);
$router->get('/articles/{slug}-{id}', ['as' => 'showArticle', 'uses' => 'ArticleController@show']);
$router->post('/articles/comment', ['uses' => 'ArticleController@comment']);
$router->post('/articles', ['uses' => 'ArticleController@store']);
$router->post('/articles/{id}', ['uses' => 'ArticleController@update']);


/*
|--------------------------------------------------------------------------
| Rewrite old URLs to new ones
|--------------------------------------------------------------------------
*/

/**
 * Matches.
 *
 * Example url: http://footyroom.com/real-madrid-0-4-barcelona-2015-11/
 */
$router->get('/{homeTeam}-{homeScore:\d+}-{awayScore:\d+}-{awayTeam}-{year:\d\d\d\d}-{month:\d\d}', ['uses' => 'CatchOldUrlController@match']);

/**
 * Previews.
 *
 * Example url: http://footyroom.com/preview/barcelona-vs-villarreal-preview-3/
 * Example url: http://footyroom.com/barcelona-vs-villarreal-preview-3-2012-02/
 */
$router->get('/preview/{slug}', ['uses' => 'CatchOldUrlController@preview']);
$router->get('/{slug:.+-vs-.+}-{year:\d\d\d\d}-{month:\d\d}', ['uses' => 'CatchOldUrlController@preview']);

/**
 * Le Mix.
 *
 * Example url: http://footyroom.com/top-10-goals-of-the-week-16112015-2015-11/
 */
$router->get('/{slug}-{year:\d\d\d\d}-{month:\d\d}', ['uses' => 'CatchOldUrlController@lemix']);

/**
 * Forum Discussions.
 *
 * Example url: http://footyroom.com/forum/off-topic/what-antivirus-do-you-use-59572
 */
$router->get('/forum/{categorySlug}/{slug}-{id:\d+}', ['uses' => 'CatchOldUrlController@forumPost']);

/**
 * Forum Discussions with page number.
 *
 * Example url: http://footyroom.com/forum/football-talk/barcelona-file-a-complaint-46174/3/
 */
$router->get('/forum/{categorySlug}/{slug}-{id:\d+}/{page:\d+}', ['uses' => 'CatchOldUrlController@forumPost']);

/**
 * Competitions.
 *
 * Example url: http://footyroom.com/videos/england/premierleague/
 */
$router->get('/videos/{region}/{competitionSlug}', ['uses' => 'CatchOldUrlController@competitions']);
$router->get('/videos/{region}/{competitionSlug}/page/{page:\d+}', ['uses' => 'CatchOldUrlController@competitions']);

/**
 * Sitemap.
 */
$router->get('/sitemap', 'SitemapController@index');
$router->get('/sitemap/forum/discussions', 'SitemapController@forumPosts');
$router->get('/sitemap/matches', 'SitemapController@matches');