aboutsummaryrefslogtreecommitdiff
path: root/app/Http/routes.php
diff options
context:
space:
mode:
authorCamil Staps2016-09-05 22:30:47 +0200
committerCamil Staps2016-09-05 22:30:47 +0200
commitfc5cef0efddbb1141b0a371108a23fc7f6e8d860 (patch)
tree8b3e62b50e5f856c57af477a78a51567d6e859f2 /app/Http/routes.php
parentUser creation and authentication (diff)
Vote on verb suggestions
Diffstat (limited to 'app/Http/routes.php')
-rw-r--r--app/Http/routes.php30
1 files changed, 24 insertions, 6 deletions
diff --git a/app/Http/routes.php b/app/Http/routes.php
index 9cf12b4..8313029 100644
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -29,7 +29,10 @@
*/
$app->group(
- ['prefix' => parse_url(env('APP_URL'), PHP_URL_PATH)],
+ [
+ 'prefix' => parse_url(env('APP_URL'), PHP_URL_PATH),
+ 'middleware' => 'login'
+ ],
function ($app) {
$app->get('/', function () use ($app) {
@@ -44,15 +47,24 @@ $app->group(
return \HebrewParseTrainer\Tense::all();
});
+ $app->get('/verb/random',
+ 'App\Http\Controllers\VerbController@random');
+
$app->get('/logout', function () use ($app) {
- return response('Unauthorized.', 401)
- ->header('WWW-Authenticate', 'Basic realm="Please click OK, then Cancel to logout."');
+ return response('You have been logged out.', 401)
+ ->header(
+ 'WWW-Authenticate',
+ 'Basic realm="Please click OK, then Cancel to logout."');
});
- $app->get('/verb/random', 'App\Http\Controllers\RandomVerbController@show');
+ $app->get('/contribute', function () use ($app) {
+ return view('contribute');
+ });
- $app->get('/user/create', 'App\Http\Controllers\UserController@createForm');
- $app->post('/user/create', 'App\Http\Controllers\UserController@createForm');
+ $app->get('/user/create',
+ 'App\Http\Controllers\UserController@createForm');
+ $app->post('/user/create',
+ 'App\Http\Controllers\UserController@createForm');
$app->group(
['middleware' => 'auth:basic-http'],
@@ -62,6 +74,12 @@ $app->group(
return view('stats');
});
+ $app->get('/verb/{id}/vote/{choice}',
+ 'App\Http\Controllers\VerbController@vote');
+
+ $app->post('/verb/suggest',
+ 'App\Http\Controllers\VerbController@suggest');
+
});
});