aboutsummaryrefslogtreecommitdiff
path: root/app/Http/Controllers/GuestbookController.php
diff options
context:
space:
mode:
authorfloppydiskette <git@diskfloppy.me>2024-08-08 22:22:38 +0100
committerfloppydiskette <git@diskfloppy.me>2024-08-08 22:22:38 +0100
commit04fc009874db2d539ad881b649f7ebb512f05312 (patch)
tree9934681b96c15ceffbc9ce8d682621ff875f1b4f /app/Http/Controllers/GuestbookController.php
parentfc5cd70e729f639aaf1c6ff6a4bf3d5d52664de9 (diff)
Init rails apprails
Diffstat (limited to 'app/Http/Controllers/GuestbookController.php')
-rw-r--r--app/Http/Controllers/GuestbookController.php47
1 files changed, 0 insertions, 47 deletions
diff --git a/app/Http/Controllers/GuestbookController.php b/app/Http/Controllers/GuestbookController.php
deleted file mode 100644
index df726ef..0000000
--- a/app/Http/Controllers/GuestbookController.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-
-namespace App\Http\Controllers;
-
-use App\Models\GuestbookEntry;
-use Illuminate\Http\Request;
-use Illuminate\Http\RedirectResponse;
-use Illuminate\Contracts\View\View;
-use Illuminate\Validation\ValidationException;
-use UAParser\Parser;
-
-class GuestbookController extends Controller {
- public function show(): View {
- $entries = GuestbookEntry::selectEntries();
- $parser = Parser::create();
-
- return view('guestbook')
- ->with('entries', $entries)
- ->with('parser', $parser);
- }
-
- /**
- * Creates a new guestbook entry
- *
- * @param Request $request
- * @return RedirectResponse
- * @throws ValidationException
- */
- public function addEntry(Request $request): RedirectResponse {
- $this->validate($request, [
- 'name' => 'required',
- 'message' => 'required'
- ]);
-
-
- GuestbookEntry::insertGuestbookEntry($request);
- return back()->with('success', 'Entry submitted successfully!');
- }
-
- public function banIP(string $addr) {
- // TODO: Add banning system
- // $matching_bans = DB::select('SELECT reason FROM guestbook__bans WHERE ip_address = ?', array($request->ip()));
- // if (!empty($matching_bans)) {
- // return view('errors.guestbook-ipban')->with('reason', $matching_bans[0]->reason);
- // }
- }
-}