mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-23 19:50:40 -05:00
add: wikis system
- migrations needed - views need to be updated to latest unit3d structure
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user