mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-01-21 03:21:38 -06:00
91 lines
2.3 KiB
PHP
91 lines
2.3 KiB
PHP
<?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\Group;
|
|
use App\Models\Internal;
|
|
use App\Models\Page;
|
|
|
|
/**
|
|
* @see \Tests\Todo\Feature\Http\Controllers\PageControllerTest
|
|
*/
|
|
class PageController extends Controller
|
|
{
|
|
/**
|
|
* Display All Pages.
|
|
*/
|
|
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
{
|
|
return view('page.index', [
|
|
'pages' => Page::all(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Show A Page.
|
|
*/
|
|
public function show(int $id): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
{
|
|
return view('page.page', [
|
|
'page' => Page::findOrFail($id),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Show Staff Page.
|
|
*/
|
|
public function staff(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
{
|
|
return view('page.staff', [
|
|
'staff' => Group::query()
|
|
->with('users:id,username,group_id,title')
|
|
->where('is_modo', '=', 1)
|
|
->orWhere('is_admin', '=', 1)
|
|
->get()
|
|
->sortByDesc('position'),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Show Internals Page.
|
|
*/
|
|
public function internal(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
{
|
|
return view('page.internal', [
|
|
'internals' => Internal::query()
|
|
->with('users')
|
|
->orderBy('name')
|
|
->get(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Show Client-Blacklist Page.
|
|
*/
|
|
public function clientblacklist(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
{
|
|
return view('page.blacklist.client', [
|
|
'clients' => BlacklistClient::all(),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Show About Us Page.
|
|
*/
|
|
public function about(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
{
|
|
return view('page.aboutus');
|
|
}
|
|
}
|