add: wikis system

- migrations needed
- views need to be updated to latest unit3d structure
This commit is contained in:
HDVinnie
2023-12-19 18:21:43 -05:00
parent 696720e5e2
commit 757af7be3e
17 changed files with 819 additions and 6 deletions
@@ -0,0 +1,115 @@
<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Http\Controllers\Staff;
use App\Http\Controllers\Controller;
use App\Models\WikiCategory;
use Illuminate\Http\Request;
class WikiCategoryController extends Controller
{
/**
* Display All Categories.
*/
public function index(): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
$categories = WikiCategory::all()->sortBy('position');
return view('Staff.wiki_category.index', ['categories' => $categories]);
}
/**
* Show Form For Creating A New Category.
*/
public function create(): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
return view('Staff.wiki_category.create');
}
/**
* Store A Category.
*/
public function store(Request $request): \Illuminate\Http\RedirectResponse
{
$category = new WikiCategory();
$category->name = $request->input('name');
$category->position = $request->input('position');
$category->icon = $request->input('icon');
$v = validator($category->toArray(), [
'name' => 'required',
'position' => 'required',
'icon' => 'required',
]);
if ($v->fails()) {
return redirect()->route('staff.wiki_categories.index')
->withErrors($v->errors());
}
$category->save();
return redirect()->route('staff.wiki_categories.index')
->withSuccess('Wiki Category Successfully Added');
}
/**
* Category Edit Form.
*/
public function edit(int $id): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
$category = WikiCategory::findOrFail($id);
return view('Staff.wiki_category.edit', ['category' => $category]);
}
/**
* Update A Category.
*/
public function update(Request $request, int $id): \Illuminate\Http\RedirectResponse
{
$category = WikiCategory::findOrFail($id);
$category->name = $request->input('name');
$category->position = $request->input('position');
$category->icon = $request->input('icon');
$v = validator($category->toArray(), [
'name' => 'required',
'position' => 'required',
'icon' => 'required',
]);
if ($v->fails()) {
return redirect()->route('staff.wiki_categories.index')
->withErrors($v->errors());
}
$category->save();
return redirect()->route('staff.wiki_categories.index')
->withSuccess('Wiki Category Successfully Modified');
}
/**
* Destroy A Category.
*/
public function destroy(int $id): \Illuminate\Http\RedirectResponse
{
$category = WikiCategory::findOrFail($id);
$category->delete();
return redirect()->route('staff.wiki_categories.index')
->withSuccess('Wiki Category Successfully Deleted');
}
}
@@ -0,0 +1,114 @@
<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Http\Controllers\Staff;
use App\Models\WikiCategory;
use App\Http\Controllers\Controller;
use App\Models\Wiki;
use Illuminate\Http\Request;
class WikiController extends Controller
{
/**
* Display All Pages.
*/
public function index(): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
return view('Staff.wiki.index', ['wikis' => Wiki::with(['category'])->get()]);
}
/**
* Page Add Form.
*/
public function create(): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
return view('Staff.wiki.create', ['categories' => WikiCategory::all()->sortBy('position')]);
}
/**
* Store A New Page.
*/
public function store(Request $request): \Illuminate\Http\RedirectResponse
{
$wiki = new Wiki();
$wiki->name = $request->input('name');
$wiki->category_id = $request->input('category_id');
$wiki->content = $request->input('content');
$v = validator($wiki->toArray(), [
'name' => 'required',
'category_id' => 'required',
'content' => 'required',
]);
if ($v->fails()) {
return redirect()->route('staff.wikis.index')
->withErrors($v->errors());
}
$wiki->save();
return redirect()->route('staff.wikis.index')
->withSuccess('Wiki has been created successfully');
}
/**
* Page Edit Form.
*/
public function edit(int $id): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
return view('Staff.wiki.edit', [
'wiki' => Wiki::findOrFail($id),
'categories' => WikiCategory::all()->sortBy('position')
]);
}
/**
* Edit A Page.
*/
public function update(Request $request, int $id): \Illuminate\Http\RedirectResponse
{
$wiki = Wiki::findOrFail($id);
$wiki->name = $request->input('name');
$wiki->category_id = $request->input('category_id');
$wiki->content = $request->input('content');
$v = validator($wiki->toArray(), [
'name' => 'required',
'category_id' => 'required',
'content' => 'required',
]);
if ($v->fails()) {
return redirect()->route('staff.wikis.index')
->withErrors($v->errors());
}
$wiki->save();
return redirect()->route('staff.wikis.index')
->withSuccess('Wiki has been edited successfully');
}
/**
* Delete A Page.
*/
public function destroy(int $id): Illuminate\Http\RedirectResponse
{
Wiki::findOrFail($id)->delete();
return redirect()->route('staff.wikis.index')
->withSuccess('Wiki has been deleted successfully');
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Http\Controllers;
use App\Models\Wiki;
use App\Models\WikiCategory;
class WikiController extends Controller
{
/**
* Display All Wikis.
*/
public function index(): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
$wiki_categories = WikiCategory::with(['wikis'])->get()->sortBy('position');
return view('wiki.index', ['wiki_categories' => $wiki_categories]);
}
/**
* Show A Wiki.
*/
public function show(int $id): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
$wiki = Wiki::findOrFail($id);
return view('wiki.show', ['wiki' => $wiki]);
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Models;
use App\Helpers\Bbcode;
use App\Helpers\MarkdownExtra;
use Illuminate\Database\Eloquent\Model;
class Wiki extends Model
{
/**
* Belongs To A Category.
*/
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(WikiCategory::class);
}
/**
* Parse Content And Return Valid HTML.
*/
public function getContentHtml(): string
{
return (new MarkdownExtra())->text((new Bbcode())->parse($this->content, false));
}
}
+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class WikiCategory extends Model
{
/**
* Indicates If The Model Should Be Timestamped.
*
* @var bool
*/
public $timestamps = false;
/**
* Has Many Wikis.
*/
public function wikis(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(Wiki::class, 'category_id');
}
}
@@ -112,6 +112,18 @@
{{ __('staff.articles') }}
</a>
</p>
<p class="form__group form__group--horizontal">
<a class="form__button form__button--text" href="{{ route('staff.bon_exchanges.index') }}">
<i class="{{ config('other.font-awesome') }} fa-coins"></i>
{{ __('staff.bon-exchange') }}
</a>
</p>
<p class="form__group form__group--horizontal">
<a class="form__button form__button--text" href="{{ route('staff.blacklisted_clients.index') }}">
<i class="{{ config('other.font-awesome') }} fa-ban"></i>
{{ __('common.blacklist') }}
</a>
</p>
@if (auth()->user()->group->is_admin)
<p class="form__group form__group--horizontal">
<a class="form__button form__button--text" href="{{ route('staff.forums.index') }}">
@@ -133,15 +145,15 @@
</a>
</p>
<p class="form__group form__group--horizontal">
<a class="form__button form__button--text" href="{{ route('staff.bon_exchanges.index') }}">
<i class="{{ config('other.font-awesome') }} fa-coins"></i>
{{ __('staff.bon-exchange') }}
<a class="form__button form__button--text" href="{{ route('staff.wiki_categories.index') }}">
<i class="fab fa-wikipedia-w"></i>
Wiki Categories
</a>
</p>
<p class="form__group form__group--horizontal">
<a class="form__button form__button--text" href="{{ route('staff.blacklisted_clients.index') }}">
<i class="{{ config('other.font-awesome') }} fa-ban"></i>
{{ __('common.blacklist') }}
<a class="form__button form__button--text" href="{{ route('staff.wikis.index') }}">
<i class="fab fa-wikipedia-w"></i>
Wikis
</a>
</p>
<p class="form__group form__group--horizontal">
@@ -0,0 +1,55 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('staff.dashboard.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.staff-dashboard')</span>
</a>
</li>
<li>
<a href="{{ route('staff.wikis.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Wikis</span>
</a>
</li>
<li class="active">
<a href="{{ route('staff.wikis.create') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Add New Wiki</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<h2>Add a new wiki</h2>
<form role="form" method="POST" action="{{ route('staff.wikis.store') }}">
@csrf
<div class="form-group">
<label for="name">Wiki __('common.name')</label>
<label>
<input type="text" name="name" class="form-control">
</label>
</div>
<div class="form-group">
<label for="category_id">Wiki Category</label>
<label>
<select name="category_id" class="form-control">
<option value="">--Select Category--</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">
{{ $category->name }}
</option>
@endforeach
</select>
</label>
</div>
<div class="form-group">
<label for="content">Content</label>
<textarea name="content" id="content" cols="30" rows="10" class="form-control"></textarea>
</div>
<button type="submit" class="btn btn-default">Save</button>
</form>
</div>
@endsection
+57
View File
@@ -0,0 +1,57 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('staff.dashboard.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.staff-dashboard')</span>
</a>
</li>
<li>
<a href="{{ route('staff.wikis.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Wikis</span>
</a>
</li>
<li class="active">
<a href="{{ route('staff.wikis.edit', ['id' => $wiki->id]) }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('common.edit') Wiki</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<h2>Edit wiki</h2>
<form role="form" method="POST" action="{{ route('staff.wikis.update', ['id' => $wiki->id]) }}">
@csrf
@method('PATCH')
<div class="form-group">
<label for="name">Wiki __('common.name')</label>
<label>
<input type="text" name="name" class="form-control" value="{{ $wiki->name }}">
</label>
</div>
<div class="form-group">
<label for="category_id">Wiki Category</label>
<label>
<select name="category_id" class="form-control">
<option value="{{ $wiki->category->id }}" selected>{{ $wiki->category->name }}
(__('torrent.current'))
</option>
@foreach ($categories as $category)
<option value="{{ $category->id }}">{{ $category->name }}</option>
@endforeach
</select>
</label>
</div>
<div class="form-group">
<label for="content">Content</label>
<textarea name="content" id="content" cols="30" rows="10"
class="form-control">{{ $wiki->content }}</textarea>
</div>
<button type="submit" class="btn btn-default">Save</button>
</form>
</div>
@endsection
@@ -0,0 +1,60 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('staff.dashboard.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.staff-dashboard')</span>
</a>
</li>
<li class="active">
<a href="{{ route('staff.wikis.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Wikis</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<h2>Wikis</h2>
<a href="{{ route('staff.wikis.create') }}" class="btn btn-primary">Add a new wiki</a>
<div class="table-responsive">
<table class="table table-condensed table-striped table-bordered table-hover">
<thead>
<tr>
<th>Title</th>
<th>Category</th>
<th>Date</th>
<th>__('common.action')</th>
</tr>
</thead>
<tbody>
@foreach ($wikis as $wiki)
<tr>
<td>
<a href="{{ route('wikis.show', ['id' => $wiki->id]) }}">
{{ $wiki->name }}
</a>
</td>
<td>
{{ $wiki->category->name }}
</td>
<td>
{{ $wiki->created_at }} ({{ $wiki->created_at->diffForHumans() }})
</td>
<td>
<form action="{{ route('staff.wikis.destroy', ['id' => $wiki->id]) }}" method="POST">
@csrf
@method('DELETE')
<a href="{{ route('staff.wikis.edit', ['id' => $wiki->id]) }}"
class="btn btn-warning">__('common.edit')</a>
<button type="submit" class="btn btn-danger">__('common.delete')</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@@ -0,0 +1,51 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('staff.dashboard.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.staff-dashboard')</span>
</a>
</li>
<li>
<a href="{{ route('staff.wiki_categories.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.torrent-categories')</span>
</a>
</li>
<li class="active">
<a href="{{ route('staff.wiki_categories.create') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Add Wiki Category</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<h2>Add A Wiki Category</h2>
<form role="form" method="POST" action="{{ route('staff.wiki_categories.store') }}" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="name">__('common.name')</label>
<label>
<input type="text" class="form-control" name="name">
</label>
</div>
<div class="form-group">
<label for="name">__('common.position')</label>
<label>
<input type="text" class="form-control" name="position">
</label>
</div>
<div class="form-group">
<label for="name">Icon (FontAwesome)</label>
<label>
<input type="text" class="form-control" name="icon"
placeholder="Example: {{ config('other.font-awesome') }} fa-rocket">
</label>
</div>
<br>
<br>
<button type="submit" class="btn btn-default">__('common.add')</button>
</form>
</div>
@endsection
@@ -0,0 +1,52 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('staff.dashboard.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.staff-dashboard')</span>
</a>
</li>
<li>
<a href="{{ route('staff.wiki_categories.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.torrent-categories')</span>
</a>
</li>
<li class="active">
<a href="{{ route('staff.wiki_categories.edit', ['id' => $category->id]) }}" itemprop="url"
class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('common.edit') Wiki Category</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<h2>__('common.edit') A Wiki Category</h2>
<form role="form" method="POST" action="{{ route('staff.wiki_categories.update', ['id' => $category->id]) }}">
@csrf
@method('PATCH')
<div class="form-group">
<label for="name">__('common.name')</label>
<label>
<input type="text" class="form-control" name="name" value="{{ $category->name }}">
</label>
</div>
<div class="form-group">
<label for="name">__('common.position')</label>
<label>
<input type="text" class="form-control" name="position" value="{{ $category->position }}">
</label>
</div>
<div class="form-group">
<label for="name">Icon (FontAwesome)</label>
<label>
<input type="text" class="form-control" name="icon" value="{{ $category->icon }}">
</label>
</div>
<br>
<br>
<button type="submit" class="btn btn-default">__('common.submit')</button>
</form>
</div>
@endsection
@@ -0,0 +1,61 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('staff.dashboard.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">__('staff.staff-dashboard')</span>
</a>
</li>
<li class="active">
<a href="{{ route('staff.wiki_categories.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Wiki Categories</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<h2>Categories</h2>
<a href="{{ route('staff.wiki_categories.create') }}" class="btn btn-primary">Add A Wiki Category</a>
<div class="table-responsive">
<table class="table table-condensed table-striped table-bordered table-hover">
<thead>
<tr>
<th>__('common.position')</th>
<th>__('common.name')</th>
<th>Icon</th>
<th>__('common.action')</th>
</tr>
</thead>
<tbody>
@foreach ($categories as $category)
<tr>
<td>
{{ $category->position }}
</td>
<td>
<a
href="{{ route('staff.wiki_categories.edit', ['id' => $category->id]) }}">{{ $category->name }}</a>
</td>
<td>
<i class="{{ $category->icon }}" aria-hidden="true"></i>
</td>
<td>
<form action="{{ route('staff.wiki_categories.destroy', ['id' => $category->id]) }}" method="POST">
@csrf
@method('DELETE')
<a href="{{ route('staff.wiki_categories.edit', ['id' => $category->id]) }}"
class="btn btn-warning">
__('common.edit')
</a>
<button type="submit" class="btn btn-danger">__('common.delete')</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@@ -32,6 +32,7 @@
<li>
<a href="{{ route('articles.index') }}">{{ __('common.news') }}</a>
</li>
<li><a href="{{ route('wikis.index') }}">Wikis</a></li>
</ul>
</section>
@if ($footer_pages)
@@ -164,6 +164,12 @@
{{ __('common.faq') }}
</a>
</li>
<li>
<a href="{{ route('wikis.index') }}">
<i class="{{ config('other.font-awesome') }} fa-list-alt"></i>
Wiki
</a>
</li>
<li>
<a href="{{ route('tickets.index') }}">
<i class="{{ config('other.font-awesome') }} fa-life-ring"></i>
+57
View File
@@ -0,0 +1,57 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('wikis.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Wikis</span>
</a>
</li>
@endsection
@section('content')
<div class="container">
<div class="block">
<div class="forum-categories">
<table class="table table-bordered table-hover">
@foreach ($wiki_categories as $category)
<thead class="no-space">
<tr class="no-space">
<td colspan="5" class="no-space">
<div class="header gradient teal some-padding">
<div class="inner_content">
<h2 class="no-space">{{ $category->name }}</h2>
</div>
</div>
</td>
</tr>
</thead>
<thead>
<tr>
<th>@lang('common.name')</th>
<th>Created</th>
<th>Updated</th>
</tr>
</thead>
<tbody>
@foreach ($category->wikis->sortBy('name') as $wiki)
<tr>
<td>
<a href="{{ route('wikis.show', ['id' => $wiki->id]) }}">
{{ $wiki->name }}
</a>
</td>
<td>
{{ $wiki->created_at }}
</td>
<td>
{{ $wiki->updated_at }}
</td>
</tr>
@endforeach
</tbody>
@endforeach
</table>
</div>
</div>
</div>
@endsection
+31
View File
@@ -0,0 +1,31 @@
@extends('layout.default')
@section('breadcrumb')
<li>
<a href="{{ route('wikis.index') }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">Wikis</span>
</a>
</li>
<li>
<a href="{{ route('wikis.show', ['id' => $wiki->id]) }}" itemprop="url" class="l-breadcrumb-item-link">
<span itemprop="title" class="l-breadcrumb-item-link-title">{{ $wiki->name }}</span>
</a>
</li>
@endsection
@section('content')
<div class="container box">
<div class="col-md-12 page">
<div class="header gradient silver">
<div class="inner_content">
<div class="page-title">
<h1>{{ $wiki->name }}</h1>
</div>
</div>
</div>
<article class="page-content bbcode-rendered">
@joypixels($wiki->getContentHtml())
</article>
</div>
</div>
@endsection
+30
View File
@@ -102,6 +102,12 @@ Route::middleware('language')->group(function (): void {
Route::get('/{page}', [App\Http\Controllers\PageController::class, 'show'])->where('id', '[0-9]+')->name('pages.show');
});
// Wiki System
Route::prefix('wikis')->group(function (): void {
Route::get('/', [App\Http\Controllers\WikiController::class, 'index'])->name('wikis.index');
Route::get('/{id}', [App\Http\Controllers\WikiController::class, 'show'])->where('id', '[0-9]+')->name('wikis.show');
});
// Extra-Stats System
Route::prefix('stats')->group(function (): void {
Route::get('/', [App\Http\Controllers\StatsController::class, 'index'])->name('stats');
@@ -1023,5 +1029,29 @@ Route::middleware('language')->group(function (): void {
Route::delete('/{watchlist}', [App\Http\Controllers\Staff\WatchlistController::class, 'destroy'])->name('destroy');
});
});
// Wiki Categories System
Route::prefix('wiki_categories')->group(function (): void {
Route::name('wiki_categories.')->group(function (): void {
Route::get('/', [App\Http\Controllers\Staff\WikiCategoryController::class, 'index'])->name('index');
Route::get('/create', [App\Http\Controllers\Staff\WikiCategoryController::class, 'create'])->name('create');
Route::post('/store', [App\Http\Controllers\Staff\WikiCategoryController::class, 'store'])->name('store');
Route::get('/{id}/edit', [App\Http\Controllers\Staff\WikiCategoryController::class, 'edit'])->name('edit');
Route::patch('/{id}/update', [App\Http\Controllers\Staff\WikiCategoryController::class, 'update'])->name('update');
Route::delete('/{id}/destroy', [App\Http\Controllers\Staff\WikiCategoryController::class, 'destroy'])->name('destroy');
});
});
// Wiki System
Route::prefix('wikis')->group(function (): void {
Route::name('wikis.')->group(function (): void {
Route::get('/', [App\Http\Controllers\Staff\WikiController::class, 'index'])->name('index');
Route::get('/create', [App\Http\Controllers\Staff\WikiController::class, 'create'])->name('create');
Route::post('/store', [App\Http\Controllers\Staff\WikiController::class, 'store'])->name('store');
Route::get('/{id}/edit', [App\Http\Controllers\Staff\WikiController::class, 'edit'])->name('edit');
Route::patch('/{id}/update', [App\Http\Controllers\Staff\WikiController::class, 'update'])->name('update');
Route::delete('/{id}/destroy', [App\Http\Controllers\Staff\WikiController::class, 'destroy'])->name('destroy');
});
});
});
});