Files
RomhackPlaza/app/Http/Controllers/EntryController.php
Benjamin a778222564 A lot of things
- Added Database page.
- Added Xenforo API compatibility
- Added Hovercard
- Added Notifications
2026-05-24 11:47:20 +02:00

33 lines
671 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Entry;
use Illuminate\Http\Request;
use Illuminate\View\View;
class EntryController extends Controller
{
private const SECTION_TYPES = [ 'translations', 'romhacks', 'homebrew', 'utilities', 'documents', 'lua-scripts', 'tutorials' ];
public function index(): View
{
return view('entries.index');
}
public function show(string $section, Entry $entry): View
{
if( ! in_array($section, self::SECTION_TYPES) )
abort(404);
if( $entry->type !== $section )
abort(404);
return view('entries.show', compact('entry', 'section'));
}
}