aboutsummaryrefslogtreecommitdiff
path: root/routes/web.php
blob: d9b39c66e5291f3b789bb9998def0e3879a60d46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\View;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

Route::get('/', function () {
    return View::make('pages.home');
});

Route::get('/bookmarks', function () {
    return View::make('pages.bookmarks');
});

Route::get('/projects', function () {
    return View::make('pages.projects');
});

Route::get('/calculators', function () {
    return View::make('pages.calculators');
});

Route::get('/computers', function () {
    return View::make('pages.computers');
});

Route::get('/guestbook', 'App\Http\Controllers\GuestbookController@guestbook')
    ->name('guestbook');

Route::post('/guestbook', 'App\Http\Controllers\GuestbookController@guestbookpost')
    ->name('guestbookPost')
    ->middleware('rate_limit');

Route::get('/weather', function () {
    return View::make('pages.weather');
});

Route::get('/music', function () {
    return View::make('pages.music');
});

Route::get('/bot', function () {
    return View::make('pages.bot');
});

/* ------------------------------ Admin Routes ------------------------------ */

//Route::get('/admin', function () {
//    if (!auth()->check()) {
//        return View::make('errors.no-auth');
//    }
//    return View::make('pages.admin.index');
//});
//
//Route::get('/admin/guestbook', function () {
//    if (!auth()->check()) {
//        return View::make('errors.no-auth');
//    }
//    return View::make('pages.admin.guestbook');
//});
//
//Route::get('/admin/guestbook/delete', function () {
//    if (!auth()->check()) {
//        return View::make('errors.no-auth');
//    }
//
//    $id = request()->input('id');
//    $entry = DB::table('guestbook__entries')->find($id);
//
//    if ($entry) {
//        // Render a confirmation view
//        return View::make('pages.admin.guestbook-del-confirm', compact('entry'));
//    } else {
//        return View::make('errors.generic-error')
//            ->with('error', "Entry not found")
//            ->with('description', "The specified entry does not exist!");
//    }
//});
//
//Route::post('/admin/guestbook/delete', function () {
//    if (!auth()->check()) {
//        return View::make('errors.no-auth');
//    }
//
//    $id = request()->input('id');
//    DB::table('guestbook__entries')->where('id', $id)->delete();
//
//    return back()->with('success', 'Entry deleted successfully!');
//});