2024-02-29 13:00:59 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2024-03-05 13:27:27 -06:00
|
|
|
use App\Interfaces\PageRepositoryInterface;
|
2024-03-01 13:34:36 -06:00
|
|
|
|
2024-02-29 13:00:59 -06:00
|
|
|
class DashController extends Controller
|
|
|
|
{
|
2024-03-05 13:27:27 -06:00
|
|
|
protected PageRepositoryInterface $pages;
|
2024-02-29 13:00:59 -06:00
|
|
|
|
2024-03-01 13:34:36 -06:00
|
|
|
public function __construct(
|
2024-03-05 13:27:27 -06:00
|
|
|
PageRepositoryInterface $pageRepository,
|
2024-03-01 13:34:36 -06:00
|
|
|
) {
|
2024-03-05 13:27:27 -06:00
|
|
|
$this->pages = $pageRepository;
|
2024-02-29 13:00:59 -06:00
|
|
|
}
|
|
|
|
|
2024-03-03 19:50:14 -06:00
|
|
|
public function start()
|
2024-02-29 13:00:59 -06:00
|
|
|
{
|
2024-03-03 17:49:05 -06:00
|
|
|
$status = session('handle') !== null ? true : false;
|
|
|
|
$result = [];
|
|
|
|
if ($status) {
|
2024-03-05 13:27:27 -06:00
|
|
|
$result = $this->pages->getGroup(1, 4);
|
2024-03-03 17:49:05 -06:00
|
|
|
}
|
2024-03-01 18:16:24 -06:00
|
|
|
return view('back.start', [
|
2024-03-03 17:49:05 -06:00
|
|
|
"status" => $status,
|
|
|
|
"result" => $result,
|
2024-03-04 20:06:36 -06:00
|
|
|
"title" => "Start"
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2024-03-05 13:27:27 -06:00
|
|
|
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($uuid)
|
2024-03-04 20:06:36 -06:00
|
|
|
{
|
|
|
|
$status = session('handle') !== null ? true : false;
|
|
|
|
$result = [];
|
|
|
|
if ($status) {
|
|
|
|
$result = $this->pages->getPage($pageNum, 4, $pageFilter);
|
|
|
|
}
|
|
|
|
return view('back.book', [
|
|
|
|
"status" => $status,
|
|
|
|
"result" => $result,
|
|
|
|
"currentPage" => $pageNum,
|
|
|
|
"title" => "Pages"
|
2024-03-01 18:16:24 -06:00
|
|
|
]);
|
2024-02-29 13:00:59 -06:00
|
|
|
}
|
|
|
|
}
|