fipamo/app/Http/Controllers/DashController.php
ro d1c3b4a8f6
page editor template rebuilt
There are some spacing issues that need to be addressed but the page
editor template has been added and the CSS all lines up

scripting is still an issue as the backend that handles content still
isn't in place, but the front facing piece is in place so now those
components can be built

scripting is going to get an overhaul anyway, so this is a good place to
start that process
2024-03-05 15:49:30 -06:00

58 lines
1.5 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Interfaces\PageRepositoryInterface;
class DashController extends Controller
{
protected PageRepositoryInterface $pages;
public function __construct(
PageRepositoryInterface $pageRepository,
) {
$this->pages = $pageRepository;
}
public function start()
{
$status = session('handle') !== null ? true : false;
$result = [];
if ($status) {
$result = $this->pages->getGroup(1, 4);
}
return view('back.start', [
"status" => $status,
"result" => $result,
"title" => "Start"
]);
}
public function book($pageFilter = 'all', $pageNum = 1)
{
$status = session('handle') !== null ? true : false;
$result = [];
if ($status) {
$result = $this->pages->getGroup($pageNum, 4, $pageFilter);
}
return view('back.book', [
"status" => $status,
"result" => $result,
"currentPage" => $pageNum,
"title" => "Pages"
]);
}
public function page($mode, $uuid)
{
$status = session('handle') !== null ? true : false;
$page = $this->pages->getById($uuid)->first();
return view('back.page', [
"status" => $status,
"mode" => $mode,
"page" => $page,
"title" => 'Editing ' . $page['title']
]);
}
}