aboutsummaryrefslogtreecommitdiff
path: root/app/Http/routes.php
diff options
context:
space:
mode:
authorCamil Staps2016-09-04 23:30:15 +0200
committerCamil Staps2016-09-04 23:30:15 +0200
commitc61b156f1bd93ec4aadd8adc78523b42b0232918 (patch)
treecd9bcb6f889dcf554818246957bed54eb14c9fbe /app/Http/routes.php
parentUse blade templates (diff)
User creation and authentication
Diffstat (limited to 'app/Http/routes.php')
-rw-r--r--app/Http/routes.php56
1 files changed, 36 insertions, 20 deletions
diff --git a/app/Http/routes.php b/app/Http/routes.php
index 67b661b..9cf12b4 100644
--- a/app/Http/routes.php
+++ b/app/Http/routes.php
@@ -28,24 +28,40 @@
|
*/
-$app->group(['prefix' => parse_url(env('APP_URL'), PHP_URL_PATH)], function ($app) {
-
- $app->get('/', function () use ($app) {
- return view('trainer');
- });
-
- $app->get('/stem', function () use ($app) {
- return \HebrewParseTrainer\Stem::all();
- });
-
- $app->get('/tense', function () use ($app) {
- return \HebrewParseTrainer\Tense::all();
- });
-
- $app->get('/verb/random', 'App\Http\Controllers\RandomVerbController@show');
-
- $app->get('/stats', function () use ($app) {
- return view('stats');
- });
-
+$app->group(
+ ['prefix' => parse_url(env('APP_URL'), PHP_URL_PATH)],
+ function ($app) {
+
+ $app->get('/', function () use ($app) {
+ return view('trainer');
+ });
+
+ $app->get('/stem', function () use ($app) {
+ return \HebrewParseTrainer\Stem::all();
+ });
+
+ $app->get('/tense', function () use ($app) {
+ return \HebrewParseTrainer\Tense::all();
+ });
+
+ $app->get('/logout', function () use ($app) {
+ return response('Unauthorized.', 401)
+ ->header('WWW-Authenticate', 'Basic realm="Please click OK, then Cancel to logout."');
+ });
+
+ $app->get('/verb/random', 'App\Http\Controllers\RandomVerbController@show');
+
+ $app->get('/user/create', 'App\Http\Controllers\UserController@createForm');
+ $app->post('/user/create', 'App\Http\Controllers\UserController@createForm');
+
+ $app->group(
+ ['middleware' => 'auth:basic-http'],
+ function ($app) {
+
+ $app->get('/stats', function () use ($app) {
+ return view('stats');
+ });
+
+ });
+
});